Marc-Andre Lemburg <m...@egenix.com> added the comment: Antoine Pitrou wrote: >> Perhaps I'm missing some feature of the new GIL. Is there some >> documentation for it somewhere ? > > Almost nothing besides what is found in ceval_gil.h and in the following > thread: > http://mail.python.org/pipermail/python-dev/2009-October/093321.html > Dave Beazley did a high-level presentation about it: > http://www.dabeaz.com/python/NewGIL.pdf
Thanks. Dave's slides help a lot. The logic certainly sounds like a major improvement ! >>> Well, if you don't use any threads you don't have to change the setting >>> in the first place :-). You might want to do it in order to >>> "micro-optimize" your app (i.e. save 1-2% on CPU-bound code), but this >>> is unnecessary with the new GIL, since the interval is ignored when >>> there's only one thread running. >> >> Hmm, how do you determine that only one thread is running ? > > Actually, I don't determine it, it's a side effect of how the GIL is > implemented. If no thread is waiting for the GIL, the main thread isn't > "asked" to drop it. > >> What if an extension uses threads that are not under Python >> control, e.g. when embedding the JVM or when using a CORBA >> ORB ? > > These don't wait for the GIL, hopefully :-) Well, they might call back into Python, but I guess that's not supported anyway, not even in 2.x, since such a thread wouldn't have a properly setup Python thread state. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue7753> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com