News for hackers. Stuff that matters.
Re:Meta pledges Three-Year sponsorship for Python if GIL rem... by Jasper_ on Saturday July 08, 2023 @10:28AM (#36644755)
foo += 1 was never atomic. It always compiled to something like:

    LOAD_FAST foo
    LOAD_CONST 1
    BINARY_OP +
    STORE_FAST foo
The GIL only protected you during any of those operations, so you can still switch threads waiting between LOAD_FAST and STORE_FAST and have a race.

There are a lot of things to be worried about with the GIL conversion of new race conditions that could happen, but there's already too much misinformation out there about the GIL, let's not spread this one even further.

There are no comments on this comment yet.