Claus Ibsen created CAMEL-26900:
-----------------------------------

             Summary: camel-base-engine - DefaultReactiveExecutor.Worker: the 
thread-confined fields do not need to be volatile
                 Key: CAMEL-26900
                 URL: https://issues.apache.org/jira/browse/CAMEL-26900
             Project: Camel
          Issue Type: Sub-task
          Components: camel-core
            Reporter: Claus Ibsen
             Fix For: 4.25.0


{{DefaultReactiveExecutor.Worker}} declares {{queue}}, {{back}} and {{running}} 
as {{volatile}}. A Worker is only reached through the {{workers}} ThreadLocal, 
so it is confined to its thread and the volatile reads and writes on every 
scheduled task are not needed.

Measured in CAMEL-25132: removing volatile gave about 2-4% on a 10-node route. 
That is within noise but was consistent, so confirm it with JMH before and 
after (single-threaded and multi-threaded on Linux).

Before changing it, check that nothing reads these fields from another thread 
(JMX attributes, the executor statistics, debug or dev-console code).

Part of CAMEL-26898.

_Claude Code on behalf of davsclaus_




--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to