David Harrison <[EMAIL PROTECTED]> writes:

> I am working on an application on Mac OS X that calls out
> to python via PyImport_ImportModule().  I find that if
> the imported module creates and starts a python thread,
> the thread seems to be killed when the import of
> the module is complete.   Is this expected?  Does
> python have to be in control to allow threads to run?

Having an imported module create a thread is a bad idea. For one
thing, the thread won't get created if the module is imported a second
time. While this may be the desired behavior, it can also be
surprising. For another, there are known behaviors in the Python
threading code that can cause deadlocks when you do this. I say
"behaviors" instead of "bugs", because the last time this came up,
there was no indication that anyone was interested in fixing this.

      <mike
-- 
Mike Meyer <[EMAIL PROTECTED]>                  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to