[concurrency-interest] Bounded PriorityBlockingQueue

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


Obviously, if the queue is contended a lot, you don't need to sort so 
much. So, you can still go for max performance.

Alex


On 26/06/2013 20:01, √iktor Ҡlang wrote:
> Hi Gustav!
>
> I was in that exact same situation a while back, (I sadly didn't 
> market it though),
> I ended up going for generality instead of performance (figuring that 
> if one wanted a Priority Queue one was not going for max performance)
>
> Impl:
>
> https://github.com/akka/akka/blob/master/akka-actor/src/main/scala/akka/util/BoundedBlockingQueue.scala
>
> Usage:
>
>     new BoundedBlockingQueue[T](capacity, new 
> PriorityQueue[T](initialCapacity, comparator))
>
> Cheers,
>>
>
> On Wed, Jun 26, 2013 at 2:23 PM, Gustav Åkesson 
> <gustav.r.akesson at gmail.com <mailto:gustav.r.akesson at gmail.com>> 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
>     <mailto:Concurrency-interest at cs.oswego.edu>
>     http://cs.oswego.edu/mailman/listinfo/concurrency-interest
>
>
>
>
> -- 
> *Viktor Klang*
> /Director of Engineering/
> Typesafe <http://www.typesafe.com/>
>
> Twitter: @viktorklang
>
>
> _______________________________________________
> 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/4a086c4f/attachment-0001.html>


More information about the Concurrency-interest mailing list