[concurrency-interest] Blocking queue

Grace Kwok gykwok at yahoo.com
Wed May 17 11:25:43 EDT 2006


Hi,

Conceptually, this is what I'd like to achieve.
Suppose I have two types of tasks they are put in some
kind of queue.

I want to have some number of threads desginated to
block on take() only on type 1 task.

I also want to have some number of threads designated
to take type 2 task and process.
However, if none of the type 2 tasks is available,
then it should take the type 1 task and starts
processing.

Is there any neat way of doing it besides making two
queues and poll on them alternatively?

Thanks!

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


More information about the Concurrency-interest mailing list