[Pythonmac-SIG] Threading and FrameWork.Application
Jack Jansen
Jack.Jansen@oratrix.com
Fri, 5 Apr 2002 11:37:33 +0200
On vrijdag, april 5, 2002, at 12:18 , Pieter Claerhout wrote:
> I tried to use the threading module to start the XML RPC server in a
> different thread (xmlrpcServer itself also is a threaded piece
> of code), but
> that seems to conflict with the mainloop. If you start this
> application, it
> starts the thread, starts the mainloop and stays in there, once
> you finish
> the mainloop, the thread continues.
You've stumbled on a bug in Framework.mainloop(): it doesn't
know anything about multiple threads. It gives time to other
applications (by calling WaitNextEvent) but not to other threads
within Python. Please file a bug report in the sourceforge
Python bugs database and assign it to me (so I won't forget to
fix this).
Does anyone have any suggestions as to what mainloop() could do
to give time to other threads? There must be a way to do this,
but I don't immediately see it...
--
- Jack Jansen <Jack.Jansen@oratrix.com>
http://www.cwi.nl/~jack -
- If I can't dance I don't want to be part of your revolution --
Emma Goldman -