Martin v. Löwis <mar...@v.loewis.de> added the comment: > I understand thread-safe. This usage is safe from Python threads > because it is all done in the context of the GIL.
No, it is not. See below. > In your example, T2 doesn't hold the GIL and so, this is the scenario > that I believe you are invoking. Assume that T2 is a Python thread. First, it doesn't hold the GIL. However, when T1 releases the GIL to invoke the CRT, T2 can acquire the GIL (which it had been waiting for, anyway), and then proceed as described. > Furthermore, since your argument assumes a rogue thread modifying the > CRT settings No, it does not. Regular Python threads can break under this patch. _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4804> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com