[concurrency-interest] BoundedPriorityBlockingQueue ?

Hanson Char hanson.char at gmail.com
Tue Sep 12 12:11:15 EDT 2006


Say if you had such BoundedPriorityBlockingQueue, what would be the
preferred behavior when the queue is full ?  Should the producer blocks in
enqueueing, or return immediately with a false boolean value ?

Hanson

On 9/12/06, rbalamohan <rbalamohan at sonoasystems.com> wrote:
>
>  My bad in not giving the complete details. Sorry about that..
>
> Actually we can make use of PriorityBlockingQueue. However, this is
> unbounded.
>
> There can be requirements where we need BOUNDED PriorityBlockingQueue.
>
> ex: Throttling number of workers in a application server or servlet
> container or something like that.
>
> 1. Lots of requests come in and we need to prioritize them and hand it
> over to the ThreadPoolExecutor.
> 2. Problem of using PriorityBlockingQueue in this case is that, it is
> unbounded. However, we need to restrict the number of requests coming in, so
> that the "Discard Policy" of the ThreadPoolExecutor can kick in.
>
> ~Rajesh.B
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/attachments/20060912/fc5fce89/attachment.html 


More information about the Concurrency-interest mailing list