News for hackers. Stuff that matters.
Re:Meta pledges Three-Year sponsorship for Python if GIL rem... by js2 on Sunday July 09, 2023 @02:27PM (#36657376)
The GIL does not protect that code anymore than it does this equivalent Python code:

  if len(lst) >= 3:
    lst[0] = "..."
    lst[1] = "..."
    lst[2] = "..."
Neither is thread safe with respect to ensuring that multiple threads don't modify lst in an interleaved fashion. If that's a critical section, then it has to be protected with a lock other than the GIL.

There are no comments on this comment yet.