When interacting with Python objects, you always need to hold the GIL. The namespace in which the variables are stored is a Python object (either a frame object or a dict, depending on which variable). It is always safe to get or set variables in multiple threads. You will never get garbage data.
However, the usual race conditions apply to which object you receive or which object you replace at the time of appointment. An operator of type x += 1 not thread safe, because another thread can run between it and the store, changing the value of x , which you then overwrite.
source share