News for hackers. Stuff that matters.
Re:Python Concurrency: The Tricky Bits by rbanffy on Thursday February 18, 2021 @07:46AM (#26179170)
"Thanks to GIL, multithreading in CPython is just broken and doesn't work."

Thanks to the GIL, multithreaded Python code doesn't have to worry too much (you do, a little) about shared mutable objects.

Re:Python Concurrency: The Tricky Bits by readmodifywrite on Thursday February 18, 2021 @11:34AM (#26181935)
The GIL is not there to prevent data corruption on shared objects - it only protects the interpreter's internal state. The fact that sometimes you can get away with it is an accident of the GIL's implementation, not a feature anyone should rely on. It also means that you cannot rely on that behavior not to change on a successive versions of CPython.

The only safe way to do shared state between threads in CPython is locks/mutexes/message passing/etc. Even things like a simple addition to an integer are absolutely not made thread safe by the GIL.

Re:Python Concurrency: The Tricky Bits by rbanffy on Thursday February 18, 2021 @02:29PM (#26184337)
No, but at least you won't have two cores incrementing the same integer at the same time.