Suggested generator to add to threading module.
aahz at pythoncraft.com
Fri Jan 16 19:07:25 CET 2004
In article <7934d084.0401152058.164a240c at posting.google.com>,
Andrae Muys <amuys at shortech.com.au> wrote:
>Found myself needing serialised access to a shared generator from
>multiple threads. Came up with the following
> lock = threading.Lock()
> while 1:
> next = gen.next()
> yield next
I'm not sure this is generic enough to go in the standard library.
Usually, I'd recommend that someone wanting this functionality consider
other options in addition to this (such as using Queue.Queue()).
Aahz (aahz at pythoncraft.com) <*> http://www.pythoncraft.com/
Q: Is top-posting okay?
More information about the Python-list