Terry Reedy <tjreedy <at> udel.edu> writes: > > I am curious as to whether the entire mechanism is or can be turned off > when not needed -- when there are not threads (other than the main, > starting thread)? It is an implicit feature: when no thread is waiting on the GIL, the GIL-holding thread isn't notified and doesn't try to release it at all (in the eval loop, that is; GIL-releasing C extensions still release it). Note that "no thread is waiting on the GIL" can mean one of two things: - either there is only one Python thread - or the other Python threads are doing things with the GIL released (zlib/bz2 compression, waiting on I/O, sleep()ing, etc.) So, yes, it automatically "turns itself off". Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4