3 ms·
The GIL is for internal python state. Not for atomic preservation of python data types. I learned very early on that python threads should be treated like C t
by bb88 5y ago
The GIL is for internal python state. Not for atomic preservation of python data types.
I learned very early on that python threads should be treated like C threads, and therefore should be avoided. Also there really isn't a performance gain to using threads (other than maybe waiting for IO completion).
- nneonneo 5y agoIf you use C code that releases the GIL, you can see big speed ups with threads. A lot of C extension modules will drop the GIL. For instance, NumPy drops the GIL for many array operations, so threads can significantly speed up numeric workloads.