| Reply | « Previous Thread | Next Thread » |
|
Hi there !
I'm trying to write on a "Text" instance from a thread, but the interpreter crash ! Is there any such a limititations ? Something like (pure example) : Code:
def thread(text):
text.add(u"Hello World from thread")
t = appuifw.Text()
appuifw.app.body = t
t.add(u"Hello World") # Work
thread.start_new_thread(thread,(t,)) # Crash
...
In a world without Walls nor Windows, who need Gates ? |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
|
Hi,
From the PyS60 documentation: Quote:
Code:
import thread
def f(text):
print "30"
thread.start_new_thread(f,tuple([None]))
|
|
Ok, thanks for information, but my UI have multiple tabs : each contains a Text object which must be updated asynchronously from data received from sockets (like a chat program)... If threads can't handle appuifw, how to do that ???
In a world without Walls nor Windows, who need Gates ? |
|
Series 60 UI is effectively single threaded. If you need to trigger UI events from worker thread you need to use e32.ao_callgate() function which delegates execution to UI thread. Also, your worker and UI threads need to proper ao_sleep() functions to give execution time to other threads.
Mikko Ohtamaa Twinapex Research http://www.twinapex.com |
|
It works ! Exactly what I searched for ! Thanks A LOT !
![]() In a world without Walls nor Windows, who need Gates ?
Last edited by nono240 : 2008-09-23 at 14:39.
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| ao_callgate and threads | happyalu | Python | 2 | 2007-04-17 20:30 |
| Threads and select | kolbi-nokia | Python | 1 | 2007-02-01 17:21 |
| Please, need help on threads | lfd | Python | 6 | 2006-11-30 17:30 |
| Cant get threads to work. | RICH? | Python | 7 | 2006-11-22 16:43 |
| Graphics and Threads | nibss | Python | 0 | 2006-06-15 06:04 |