use of Queue
Raymond Hettinger
python at rcn.com
Wed Aug 27 22:19:45 EDT 2008
On Aug 27, 4:55 pm, Paul Rubin <http://phr...@NOSPAM.invalid> wrote:
> s... at pobox.com writes:
> > Or make the consumers daemon threads so that when the producers are finished
> > an all non-daemon threads exit, the consumers do as well.
>
> How are the consumers supposed to know when the producers are
> finished? Yes, there are different approaches like sentinels, but the
> absence of a unified approach built into the library really does seem
> like a deficiency in the library.
See effbot's reply. The task_done and join methods were put there for
exactly this use case.
Raymond
More information about the Python-list
mailing list