[
https://issues.apache.org/jira/browse/ARTEMIS-2177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Francesco Nigro updated ARTEMIS-2177:
-------------------------------------
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.
was:
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 same behaviour could be improved both by:
- using a lock-free queue that would eventually signal any (if any) threads
only if there is some
- using a work stealing pool
> Allow to use work-stealing thread pool executor
> -----------------------------------------------
>
> Key: ARTEMIS-2177
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2177
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: Broker
> Affects Versions: 2.6.3
> Reporter: Francesco Nigro
> Assignee: Francesco Nigro
> Priority: Major
>
> 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.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)