[Pythonmac-SIG] Carbon events

Jack Jansen jack@oratrix.nl
Tue, 14 Aug 2001 13:10:02 +0200


> Is MacPython multi-threaded?  Is part of the idea here to make it 
> multithreaded?  Or just to make it more efficient without completely 
> ripping it apart?

The latter. Currently MacPython is a cpu-hog on OSX, and I'd like to make this 
a bit better. But going the whole way of making it multithreaded is probably 
too much work (esp since I want to start moving towards unix-Python on OSX).

> Exactly what kinds of events can and should be processed while blocked 
> on an async I/O request, without causing nasty re-entrancy problems?

Hmm, interesting. Most of the ones I would need (like clicking to another app) 
are of course already handled. That would leave only console window redraws, I 
guess.

[thinking out loud] So the reason MacPython uses so many cycles on OSX is 
probably because the lowlevel I/O wait is a tight loop that calls WNE with a 
small timeout and then checks a flag to see whether an async I/O completion 
routine was called while in WNE. So the real problem is that we use small 
timeouts to WNE, if we could use large timeouts there and have the I/O 
completion routine somehow wake up WNE that would help a lot....

Any ideas in this area? Can I wake up WNE from an interrupt routine?


--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@oratrix.com | ++++ if you agree copy these lines to your sig ++++
www.oratrix.nl/~jack    | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm