3 ms·
The GIL protects interpreter resources, not your program. If you have concurrent access to your own objects you need your own locks.
by miraculixx 3y ago
The GIL protects interpreter resources, not your program. If you have concurrent access to your own objects you need your own locks.
- nomel 3y ago“Interpreter resources” are just python primitives, from the user perspective. And, from that perspective, you can sometimes get away without using user managed locks, by relying on the GIL, in your objects. For example, you can trivially use a list as a multi threaded queue, using `.append()` and `.pop()`.