I have found several SO questions asking about this in one way or another, but none of them actually either give a list or refer to one.
This question refers to a wiki page, but while the wiki page talks about the GIL and multi-threading, it doesn't give a list of GIL releasing functions.
This mailing list post indicates that the only way to find out is to read the numpy source. Really?
According to this scipy cookbook, if you are using numpy to do array operations then Python will release the GIL, meaning that if you write your code in a numpy style, much of the calculations will be done in a few array operations, providing you with a speedup by using multiple threads.
NumPy provides familiar mathematical functions such as sin, cos, and exp. In NumPy, these are called “universal functions” ( ufunc ). Within NumPy, these functions operate elementwise on an array, producing an array as output.
In CPython, the global interpreter lock, or GIL, is a mutex that protects access to Python objects, preventing multiple threads from executing Python bytecodes at once. The GIL prevents race conditions and ensures thread safety. A nice explanation of how the Python GIL helps in these areas can be found here.
In CPython, the Global Interpreter Lock (GIL) is a mutex that allows only one thread at a time to have the control of the Python interpreter. In other words, the lock ensures that only one thread is running at any given time. Therefore, it is impossible to take advantage of multiple processors with threads.
It's not guaranteed to catch everything, but I just ran:
git grep nogil
in my clone of the numpy repository. It turns up 82 usages in 2 files:
random/mtrand/mtrand.pyx
random/mtrand/numpy.pxd
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With