[issue28382] Possible deadlock on sys.stdout/stderr when combining multiprocessing with threads

2017-07-23 Thread Antoine Pitrou
Antoine Pitrou added the comment: Also, a reliable fix is to use the "forkserver" (or "spawn", but it is much slower) method: https://docs.python.org/3/library/multiprocessing.html#contexts-and-start-methods -- ___ Python tracker

[issue28382] Possible deadlock on sys.stdout/stderr when combining multiprocessing with threads

2017-07-22 Thread Antoine Pitrou
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