Thread Safety

Martin v. Löwis martin at v.loewis.de
Fri Oct 3 15:03:53 EDT 2003


jcb at iteris.com (MetalOne) writes:

> The problem in Java is one of visibility. Assigning 
> s = "hello"
> does not necessarily happen if < s > is not used in the current
> thread.

I see. Python does guarantee that assignments are visible in other
threads once they have completed. It also guaranteed that the thread
either sees the old or the new value, i.e. assignments are atomic
(unless an object implements __setitem__).

Regards,
Martin




More information about the Python-list mailing list