Charles-François Natali added the comment: > Also, even though an IO call _can_ block, that doesn't mean that > we _must_ release the gil for the duration.
Yes, otherwise some people will complain when the whole interpreter is stuck while a socket/NFS file handle/whatever is shutdown. This problem isn't specific to multiprocessing: for example, if a daemon thread's thread state is cleared as part of the shutdown procedure, and one of the TLS object releases the GIL (e.g. a database connection), you'll have the same kind of problem. AFAICT, it's "solved" in Python 3 because, as Richard said, you can't acquire the GIL once the interpreter is shutting down. Daemon threads are *really* tricky, since they can wake-up while the interpreter is shutting down. So they should be avoided as much as possible. We can also try to think some more about a way to avoid/limit this type of issue, but it's not trivial... ---------- nosy: +neologix, pitrou _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17969> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com