Issue 1147646: Windows deadlock with PyEval_ReleaseLock (original) (raw)
Issue1147646
Created on 2005-02-22 19:04 by montulli, last changed 2022-04-11 14:56 by admin. This issue is now closed.
Messages (4) | ||
---|---|---|
msg60673 - (view) | Author: Lou Montulli (montulli) | Date: 2005-02-22 19:04 |
This problem is described well by this post from '03 http://mail.python.org/pipermail/python-dev/2003-August/037729.html The problem still seems to exist. The solution described within the post will not work in all cases because if you do not call PyEval_ReleaseLock then other threads will be deadlocked, and if you do call PyEval_ReleaseLock, the thread that originally called InitThreads will be deadlocked. The only work around that I have found so far is to use a separate thread that will never call scripts call InitThreads and then PyEval_ReleaseLock. After that all threads will run correctly, but the thread that originally called InitThreads cannot run python. Feel free to contact me for any other details, or call me a bonehead if I screwed something up. lou a montulli o org | ||
msg109747 - (view) | Author: Mark Lawrence (BreamoreBoy) * | Date: 2010-07-09 15:10 |
Anyone with Windows threading experience who could comment on this please, i.e. is it still an issue? | ||
msg109765 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * ![]() |
Date: 2010-07-09 16:38 |
This issue looks invalid to me: PyEval_ReleaseLock manipulates the interpreter lock, but not the thread state. Both have to be released/reset before another thread can install its own thread state and run. In other words, PyEval_SaveThread() should be used instead (and PyEval_RestoreThread() at the end, but the example code does not care to finalize the interpreter) | ||
msg109830 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * ![]() |
Date: 2010-07-10 07:32 |
This is actually the same issue as |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:56:09 | admin | set | github: 41614 |
2010-07-10 07:32:02 | amaury.forgeotdarc | set | status: open -> closedresolution: duplicatesuperseder: PyGILState_Ensure does not acquires GILmessages: + |
2010-07-09 16:38:01 | amaury.forgeotdarc | set | nosy: + amaury.forgeotdarcmessages: + |
2010-07-09 15:10:54 | BreamoreBoy | set | versions: + Python 3.1, Python 2.7, Python 3.2, - Python 2.6 |
2010-07-09 15:10:14 | BreamoreBoy | set | nosy: + BreamoreBoymessages: + |
2009-02-16 01:01:10 | ajaksu2 | set | title: Windows deadlock with PyEval_ReleaseLock -> Windows deadlock with PyEval_ReleaseLockstage: test neededtype: behaviorversions: + Python 2.6, - Python 2.4 |
2005-02-22 19:04:55 | montulli | create |