[concurrency-interest] Special Conditions and PriorityBlockingQueue

David Walend david at walend.net
Mon Sep 25 13:01:17 EDT 2006

On Sep 23, 2006, at 12:00 PM, concurrency-interest- 
request at cs.oswego.edu wrote:

> From: David Walend <david at walend.net>
> Subject: [concurrency-interest] Special Conditions and
> 	PriorityBlockingQueue
> Multiple Conditions: Write a custom BlockingQueue with a Condition
> for each message selector. Start with the code for
> PriorityBlockingQueue. Add custom code to create a Map<JMS
> QueueReceiver with a MessageSelector,Condition>, that holds waiting
> receivers. When a message enters the queue, check the waiting
> receivers to see if any message selectors match the message; if so,
> signal that receiver's take() or poll() call. When a receiver first
> take()s or poll()s or is signaled by its Condition, iterate through
> the queue for a matching message. If there's a message, return it and
> (if needed) remove the entry from the Map. If no message matches, add
> the receiver to the Map.

Is there a way to remove a Condition once Lock.newCondition() has  
been called? If not, how much overhead does the Condition take if  
it's never .signal()ed?



David Walend
david at walend.net

More information about the Concurrency-interest mailing list