[Python-Dev] Bootstrap issue: "select" is compiled "too late"

Antoine Pitrou solipsis at pitrou.net
Fri Oct 5 01:47:53 CEST 2012
On Thu, 4 Oct 2012 22:08:40 +0530
Nick Coghlan <ncoghlan at gmail.com> wrote:
> On Thu, Oct 4, 2012 at 7:54 PM, Brett Cannon <brett at python.org> wrote:
> > This used to be a no-no, though, because if someone called that function in
> > a thread during an import it would deadlock. Now Antoine reworked the locks
> > so I don't know if this is still true or not.
> 
> You can still technically deadlock, but you need a circular import
> *and* two different threads that start at different parts of the
> cycle.

Actually, this is detected and handled fine (a partial module is
returned to one of the two threads):
http://hg.python.org/cpython/file/b08416a31d15/Lib/test/test_threaded_import.py#l170
http://hg.python.org/cpython/file/b08416a31d15/Lib/test/test_importlib/test_locks.py#l43

Regards

Antoine.


-- 
Software development and contracting: http://pro.pitrou.net




More information about the Python-Dev mailing list