Chris Angelico <ros...@gmail.com>: > On Wed, Oct 26, 2016 at 11:58 PM, Marko Rauhamaa <ma...@pacujo.net> wrote: >> I can't think of a valid program that could take advantage of this >> primitive guarantee of Python's. For example, there is no "volatile" >> in Python so you can't coordinate Python threads safely without >> proper synchronization. If you set a variable in one thread and read >> it in another thread, the latter might never see the change. > > Incorrect. If you set something in one thread and read it in another, > it WILL see it, just as it would with any other way of running two > functions. (Obviously function locals won't be seen, because they > never will.) Global state is shared across all threads.
I don't know what "Global state is shared across all threads" means in this context. It sounds like something that would be true for, say, Java and C as well. However, those languages don't promise to propagate improperly synchronized changes between threads. Now I would like to ask for some documentation. Marko -- https://mail.python.org/mailman/listinfo/python-list