On 11-06-08 06:28 PM, Tom Brown wrote:
I found that PyEval_ReleaseLock() was necessary to keep the program from hanging. The lock() and unlock() methods were used in a previous attempt to lock/unlock the GIL.

I just tried your example code and indeed it segfaults as is, but works fine for me when I comment out PyEval_ReleaseLock(). Perhaps this was just a red herring, not actually solving your deadlock problem properly? (That is, replacing one problem with another.)


I kept banging at this and finally gave up on the GIL. I used a mutex instead. This allowed me to get rid of the Python API calls that dealt with the GIL. It works great in the test program. I'll find out how well it performs in the real program.

I suppose this could theoretically work in your specific example, but if the Python module you're calling out to spawns threads you're screwed. :)

Cheers,
Jason.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to