Martin v. Löwis wrote: > Neal Norwitz wrote: >>> As I said: I doubt it is the right thing to do. Instead, the lock >>> should get released in the child process if it is held at the >>> point of the fork. >>> >> I'm not sure if this bug can be reproduced now, but the comment in >> warnings.py points to: >> >> http://python.org/sf/683658 >> >> I didn't investigate it further. That might allow someone to create a >> reproducible test case. > > That's a different problem, though. Here, the main thread waits for a > child *thread* while holding the import lock. I don't quite understand > the test case given, and I can't make it deadlock anymore (probably > because of Just's fix). And if I understand it correctly, it falls under the category that waiting for another thread while holding the import lock is a *really* bad idea from a thread safety point of view. The thing with the import-after-fork deadlock is that you can trigger it without even doing anything that's known not to be thread-safe. Cheers, Nick. -- Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia --------------------------------------------------------------- http://www.boredomandlaziness.org
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4