Re: [Python-ideas] Thread-safe generators

2017-04-15 Thread Guido van Rossum
My 2 cent's worth, don't even think about it. On Apr 15, 2017 3:27 AM, "Serhiy Storchaka" wrote: > 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 addition

Re: [Python-ideas] Thread-safe generators

2017-04-15 Thread Serhiy Storchaka
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

Re: [Python-ideas] Thread-safe generators

2017-04-15 Thread Nick Coghlan
On 15 April 2017 at 02:47, Serhiy Storchaka wrote: > When use a generator from different threads you can get a ValueError > "generator already executing". Getting this exception with the single thread > is a programming error, it in case of different threads it could be possible > to wait until ot

Re: [Python-ideas] Thread-safe generators

2017-04-15 Thread Stephen J. Turnbull
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? ___