2 ms·
> Python’s GIL does exactly nothing to prevent data races (or any other concurrency issues) That sounds good and authoritative. Unfortunately the Python docum
by ajross 5y ago
> Python’s GIL does exactly nothing to prevent data races (or any other concurrency issues)
That sounds good and authoritative. Unfortunately the Python documentation itself is silent on the subject. And more importantly the Python community is filled with people who believe exactly the opposite.
It's a real hole. And the only solution right now is to tell everyone to avoid threads. The Python world simply isn't prepared for them.
FWIW: I'm one of a handful of people who have found and fixed race conditions in python scripts. And it was largely because my background is in racey C code and my eyes were primed to see it. And even then, I genuinely thought (based on incorrect advice like the above) that this sort of thing was impossible and kept looking before trying the obvious synchronization solution. And it was only then that I realized what a mess concurrency is in the mind of the modern python developer.