[Pythonmac-SIG] Hung like a snake...

Jack Jansen Jack.Jansen@cwi.nl
Thu, 10 Sep 1998 17:41:30 +0200


> If I were to create a mac app that could be extended with Python scripts how would I gracefully deal with the possibility of a script getting into an infinite loop and hanging?
> 
> Is threading the answer? Is threading implemented properly on the Mac?

Threading isn't implemented on the mac yet, so I'm afraid that that's not the 
answer. The inner loop of the interpreter does however call out to 
PyErr_CheckSignals(), which not only checks for command-dot but also yields 
the processor to background jobs and such (unless the program has disabled 
this with MacOS.SchedParams).

You could easily hook into this code, you find it all in Mac:Python:macglue.c.

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