Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardPythonThe GILSingle-choice MCQ

In CPython, which operation is NOT guaranteed to be atomic with respect to other threads purely because of the GIL, and therefore needs an explicit lock?

# Module level x = 0 def worker(): for _ in range(100000): x += 1 # not thread-safe