Antoine Pitrou added the comment: Ok, after a bit of diagnosing, the issue is combining multi-threading with use of fork(). The problem is file objects (such as sys.stdout) have locks but those locks may be taken at the exact point where fork() happens, in which case the child will block when trying to take the lock again.
This is mostly a duplicate of issue 6721, but perhaps multiprocessing could at least improve things for sys.stdout and sys.stderr (though I'm not sure how). This is also compounded by the fact that Process._bootstrap() flushed the standard streams at the end. ---------- nosy: +davin, pitrou title: Possible deadlock after many multiprocessing.Process are launch -> Possible deadlock on sys.stdout/stderr when combining multiprocessing with threads versions: +Python 3.6, Python 3.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28382> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com