Threads, Callbacks, Classes [Long]
Gerson Kurz
gerson.kurz at t-online.de
Tue Jun 26 10:18:35 EDT 2001
Folks, it gets weirder.
Here is a test DLL (MSDEV project) plus a testscript:
http://www.p-nand-q.com/python/pxfstest.zip (6438 Bytes)
Its really easy, just two functions, one synchronous, one
asynchronous.
a) given a msgport of the form
import Queue
msgport = Queue.Queue()
a callback "msgport.put" works, *if* called from the same thread. it
does NOT work if called from another thread - no message will be
posted in this case.
b) If I use a callback function (see pxfstest.py), I get the error
messages
Fatal Python error: PyEval_ReleaseThread: wrong thread state
Fatal Python error: PyThreadState_Get: no current thread
and an exception somewhere in python21_d.dll (I'm using ActiveState
ActivePython 2.1) even though the callback got called properly.
I'm completely @ loss what happens here.
More information about the Python-list
mailing list