[ 
https://issues.apache.org/jira/browse/ARTEMIS-2236?focusedWorklogId=188791&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-188791
 ]

ASF GitHub Bot logged work on ARTEMIS-2236:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 23/Jan/19 10:04
            Start Date: 23/Jan/19 10:04
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on pull request #2514: ARTEMIS-2236 
Address Latency Impact caused by ARTEMIS-1451
URL: https://github.com/apache/activemq-artemis/pull/2514#discussion_r250124916
 
 

 ##########
 File path: 
artemis-commons/src/main/java/org/apache/activemq/artemis/utils/ActiveMQThreadPoolExecutor.java
 ##########
 @@ -64,20 +63,15 @@ public void setExecutor(ActiveMQThreadPoolExecutor 
executor) {
       public boolean offer(Runnable runnable) {
          boolean retval = false;
 
-         // Need to lock for 2 reasons:
-         // 1. to safely handle poll timeouts
-         // 2. to protect the delta from parallel updates
-         synchronized (lock) {
-            if ((executor.getPoolSize() >= executor.getMaximumPoolSize()) || 
(threadTaskDelta > 0)) {
-               // A new task will be added to the queue if the maximum number 
of threads has been reached
-               // or if the delta is > 0, which means that there are enough 
idle threads.
+         if (threadTaskDelta > 0 || (executor.getPoolSize() >= 
executor.getMaximumPoolSize())) {
 
 Review comment:
   Not a significan change, but why you've inverted the checks here?
   The common path should be that you have all the threads busy up and running 
(so `executor.getPoolSize() >= executor.getMaximumPoolSize() = true`): it would 
avoid checking the delta...
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 188791)
    Time Spent: 11h 10m  (was: 11h)

> Address Latency Impact caused by ARTEMIS-1451
> ---------------------------------------------
>
>                 Key: ARTEMIS-2236
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2236
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.4.0, 2.5.0, 2.6.0
>            Reporter: Michael Andre Pearce
>            Priority: Blocker
>          Time Spent: 11h 10m
>  Remaining Estimate: 0h
>
> h1. ARTEMIS-1451 whilst may have removed syncronisation, increased latency as 
> the overhead of creating a new thread vs re-using an idle one is significant. 
> It is the main reason of a thread pool.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to