Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Abandoned
-
2.6.3
-
None
-
None
Description
Currently ActiveMQThreadPoolExecutor uses internally a shared LinkedBlocking queue that always perform a lock to push messages into the queue and signal to wake up any (if any) awaiting consumer thread.
This mechanics has 2 disadvantages:
- given that the Runnable queue is contended among all the offering/consuming threads it scales negatively
- the cost on offer side of awaking a dormient thread is quite high
To improve this behaviour would be nice to use a work stealing pool that spread the cost of using the same queue by
distributing the offers among different runnable queues and that can reduce the cost of awaking a dormient thread only if no thread is able
to execute a submitted task.
Such work stealing pool already exists and is the ForkJoin pool available from Java >=8.