[concurrency-interest] Bounded PriorityBlockingQueue

√iktor Ҡlang viktor.klang at gmail.com
Wed Jun 26 15:01:58 EDT 2013


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>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
>
>


-- 
*Viktor Klang*
*Director of Engineering*
Typesafe <http://www.typesafe.com/>

Twitter: @viktorklang
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20130626/387b8096/attachment.html>


More information about the Concurrency-interest mailing list