On Thu, 4 Oct 2012 22:08:40 +0530
Nick Coghlan <ncogh...@gmail.com> wrote:
> On Thu, Oct 4, 2012 at 7:54 PM, Brett Cannon <br...@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


_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to