"Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Larry Hastings schrieb: > > Oof! I'm embarrassed to have forgotten that. But that's not a fatal > > problem. It means that on Windows the PerfectReactor must service the > > blocking GetMessage loop, and these other threads notify the > > PerfectReactor of new events by sending a message. > ... > > I'd be interested to hear about other situations where threading would > > cause a problem. My suspicion is that Windows is the hard one, and as > > I've shown that one is solvable. > > As others have reported: if you have a gtk reactor and a wx reactor > to support, in addition to a "regular" Win32 reactor (e.g. PythonWin), > your approach still won't work. They all do GetMessage behind the > scenes (sp?), yet you would run them in multiple threads, so they > get their own messages. Plus they are not thread-safe.
At least on the wx side of things, there exist ways of scheduling calls to be executed inside its event dispatching loop (wx.CallAfter, wx.FutureCall, wx.PostEvent), which allows for worker threads to hand data back to the main thread (the creator of the wx.App instance, like Tk). I would be surprised if the other toolkits didn't have something similar, couldn't be manipulated into using Queues to communicate in some way, or couldn't be manipulated into directly sending a message on win32. - Josiah _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com