[issue8098] PyImport_ImportModuleNoBlock() may solve problems but causes others.

Nick Coghlan report at bugs.python.org
Tue Jul 13 14:21:44 CEST 2010


Nick Coghlan <ncoghlan at gmail.com> added the comment:

OK, finally tracked down some of the history here. Issue 1567 is the one where Christian developed the relevant patch which was then committed as r59678.

Issue 7980 is also potentially related (although that's apparently a Mac OS X crash involving time.strptime rather than an ImportError exception).

I think what it boils down to is that this approach to the import deadlock problem is far too pessimistic. If any other import is going on when an implicit import is triggered using this function makes the assumption that the other thread is going to be waiting for the current thread at some point, so this thread can't afford to wait for the import lock and should throw an exception instead. That's going to disallow a lot of perfectly legitimate imports, particularly when the Python interpreter is embedded in a multi-threaded application rather than running standalone.

----------

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


More information about the Python-bugs-list mailing list