Re:What's up, Python? The GIL removed, a new compiler, optpa...
by dpedu on Sunday July 30, 2023 @08:07PM
(#36937418)
You're right, the GIL certainly doesn't automatically make all code thread-safe. However, it does make some operations that would normally be problematic in a multithreaded context thread-safe. Such as: appending to a list, updating a dict, modifying object attributes, and others.
https://docs.python.org/3/faq/library.html#what-kinds-of-glo...
Re:What's up, Python? The GIL removed, a new compiler, optpa...
by angus_gh on Sunday July 30, 2023 @09:24PM
(#36937875)
The no-gil fork of Python makes the builtin collections thread-safe, so that will remain not an issue (see the "Collection thread-safety" section of the design doc https://docs.google.com/document/d/18CXhDb1ygxg-YXNBJNzfzZsD... )
People just mostly don't bother writing threaded code in Python today because it provides no performance benefit. That may change, and it very likely will expose many threading bugs that already exist in many libraries that just have never been found.