[issue12352] multiprocessing.Value() hangs

STINNER Victor report at bugs.python.org
Tue Jun 28 00:28:02 CEST 2011


STINNER Victor <victor.stinner at haypocalc.com> added the comment:

heap_gc_deadlock_lockless.diff: _free_pending_blocks() and free() execute the following instructions in a different order, is it a problem?

+            self._free(block)
+            self._allocated_blocks.remove(block)

vs

+                self._allocated_blocks.remove(block)
+                self._free(block)

You may call _free_pending_blocks() just after loack.acquire() and a second time before before lock.release()... it is maybe overkill, but it should reduce the probability of the delayed free problem.

You may document that _pending_free_blocks.append() and _pending_free_blocks.pop() are atomic in CPython and don't need a specific lock.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12352>
_______________________________________


More information about the Python-bugs-list mailing list