[concurrency-interest] Bounded PriorityBlockingQueue

Oleksandr Otenko oleksandr.otenko at oracle.com
Wed Jun 26 15:12:22 EDT 2013

Your queue always rearranges elements - both on enqueue and dequeue.

You need to figure out how to take advantage of elements being ordered 
after any enqueue. There are many publications on this.


On 26/06/2013 19:23, Gustav Åkesson wrote:
> Hi,
> I had a use case for a bounded priority blocking queue in a 
> large-scale server but couldn't find any useful implementation. Below 
> is my implementation:
> https://github.com/gakesson/ConcurrencyUtils/blob/c5794c5b7c0ada763549cadfbbbd345713ace79a/BoundedPriorityBlockingQueue.java
> Feel free to have a look at it, test it and come up with feedback and 
> improvements. Also, if you have had the same requirements as I, feel 
> free to use it but don't forget to contribute if/when you find 
> improvements. :-)
> Best Regards,
> Gustav Åkesson
> Cogitel AB
> Sweden
> _______________________________________________
> Concurrency-interest mailing list
> Concurrency-interest at cs.oswego.edu
> http://cs.oswego.edu/mailman/listinfo/concurrency-interest

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20130626/87ad8189/attachment.html>

More information about the Concurrency-interest mailing list