Question regarding thread atomicity

Jon Ribbens jon+usenet at unequivocal.co.uk
Mon Nov 24 12:45:12 EST 2003


If I have the following line of Python code:

  self.foo.bar += 1

where 'foo' is an instance of an object and 'bar' is an integer,
is that thread-safe? i.e. will the GIL mean that it is reliable,
or do I need to manually add locking around it?




More information about the Python-list mailing list