[concurrency-interest] Class striped/ordered Thread Pool

Aleksey Shipilev aleksey.shipilev at gmail.com
Fri May 11 07:19:05 EDT 2012


On Fri, May 11, 2012 at 12:23 PM, Dr Heinz M. Kabutz
<heinz at javaspecialists.eu> wrote:
> I don't think you need to change anything in your thread pool to get this to
> work.  All you need is the right type of queue.

I have mixed feeling about this. It really depends on the work you are
feeding into this pool.

The trouble I'm seeing is scanning through these class-specific queues
would take considerable time for large amount of classes. Also, if the
classes are not known in advance, you face with the dynamic updates
(and race-free purges ;)) the Map<StripeObject, BlockingQueue>. That
gets more interesting without having out-of-the-box
ConcurrentIdentityHashMap.

I advocate that multiplexing based on hashcode (or other the
distinguishing flags) is more elegant solution. The major benefit I'm
seeing in Heinz scheme is one global thread pool, which can share
threads between different classes. However, I advocate that given the
near-uniform stream of large amount of classes provides the needed
balancing in fixed-multiplexing scheme.

> If you like, I can try and write it for you tomorrow on my travels back to
> Greece from Germany.  No charge of course.

Please do that for me as well :) It is a nice benchmark game I would
probably like to participate in.

-Aleksey.



More information about the Concurrency-interest mailing list