Raymond Hettinger wrote:
FWIW, I've been working on a way to simplify the use of queues with daemon
consumer threads
Sometimes, I launch one or more consumer threads that wait for a task to
enter a
queue and then work on the task. A recurring problem is that I sometimes need
to
know
FWIW, I've been working on a way to simplify the use of queues with daemon
consumer threads
Sometimes, I launch one or more consumer threads that wait for a task to enter
a
queue and then work on the task. A recurring problem is that I sometimes need
to
know if all of the tasks have been
Isn't this a job for threading.BoundedSpemaphore()?
On 3/14/06, Raymond Hettinger [EMAIL PROTECTED] wrote:
FWIW, I've been working on a way to simplify the use of queues with daemon
consumer threads
Sometimes, I launch one or more consumer threads that wait for a task to
enter a
queue and
On 3/14/06, Raymond Hettinger [EMAIL PROTECTED] wrote:
FWIW, I've been working on a way to simplify the use of queues with daemon
consumer threads
Sometimes, I launch one or more consumer threads that wait for a task to
enter a
queue and then work on the task. A recurring problem is that I
On 3/14/06, Guido van Rossum [EMAIL PROTECTED] wrote:
Isn't this a job for threading.BoundedSpemaphore()?
Not sure I see how. What I think Raymond's after (and certainly what I
want) is to queue N tasks, set a counter to N, then wait until the
counter goes to zero.
I suppose
counter =
Isn't this a job for threading.BoundedSpemaphore()?
I don't see how that would work. ISTM that we need an inverse of a
BoundedSemaphore. If it understand it correctly, a BS blocks after some
pre-set
maximum number of acquires and is used for resources with limited capacity
(i.e.
a number
I think I was thinking of the following: create a semaphore set to
zero; the main thread does N acquire operations; each of N workers
releases it once after it's done. When the main thread proceeds it
knows all workers are done. Doesn't that work? Also, I believe Tim
once implemented a barrier
[Raymond Hettinger]
FWIW, I've been working on a way to simplify the use of queues with
daemon consumer threads
Sometimes, I launch one or more consumer threads that wait for a task
to enter a queue and then work on the task. A recurring problem is that
I sometimes need to know if all of the