Message214380
At Enthought we have been tracking a deadlock in some code that turned out to be due to the following scenario:
0) There is some cyclic garbage that requires collection; an object in the garbage is referred to by a weakref with a callback
1) You have a lock that is acquired
2) While the lock is held, the garbage collector runs (on the same thread)
3) The weakref callback in (0) is called via the garbage collecter and the callback tries to acquire the same lock that was acquired in (1)
Attached is a simple script that exercises the issue in Python 3.3. The script monkey-patches Queue.get to force garbage collection after acquiring the Queue.not_empty lock. |
|
Date |
User |
Action |
Args |
2014-03-21 15:47:26 | simon.jagoe | set | recipients:
+ simon.jagoe |
2014-03-21 15:47:26 | simon.jagoe | set | messageid: <1395416846.85.0.759574712799.issue21009@psf.upfronthosting.co.za> |
2014-03-21 15:47:26 | simon.jagoe | link | issue21009 messages |
2014-03-21 15:47:26 | simon.jagoe | create | |
|