[issue9260] A finer grained import lock

Graham Dumpleton report at bugs.python.org
Thu Jul 15 00:36:09 CEST 2010


Graham Dumpleton <Graham.Dumpleton at gmail.com> added the comment:

How is this going to deal with cyclical imports where different threads could import at the same time different modules within that cycle? I need to look through the proposed patch and work out exactly what it does, but am concerned about whether this approach would cause the classic deadlock problem if not done right?

FWIW, this concept of a lock per module is what I used in the mod_python module importer when it was rewritten. I would have to go look back over that code and see how the way the concept is being implemented differs, but there was one remaining potential race condition in the mod_python code which could in rare instances cause a problem. I never did get around to fixing it. Anyway, what I did learn was that this approach isn't necessarily as simple as it may seem so it will need some really good analysis on whatever solution is developed to ensure subtle problems don't come up.

----------

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


More information about the Python-bugs-list mailing list