[Python-ideas] Thread-safe generators

Serhiy Storchaka storchaka at gmail.com
Sat Apr 15 06:26:04 EDT 2017


On 15.04.17 11:55, Stephen J. Turnbull wrote:
> Serhiy Storchaka writes:
>
>  > The first thread just sets the running flag (as in current code). Due to
>  > GIL this doesn't need additional synchronization.
>
> Can we assume this lack of additional synchronization for other
> implementations?  If not, do we care?

Other implementations should have atomic test-and-set operations for the 
running flag. Or other ways to prevent a race condition. So yes, we can 
assume this.




More information about the Python-ideas mailing list