orpiske commented on code in PR #9986:
URL: https://github.com/apache/camel/pull/9986#discussion_r1183728748
##########
core/camel-support/src/main/java/org/apache/camel/support/cache/DefaultProducerCache.java:
##########
@@ -120,11 +123,20 @@ public Object getSource() {
@Override
public AsyncProducer acquireProducer(Endpoint endpoint) {
+ // Try to favor thread locality as some data in the producer's cache
may be shared among threads,
+ // triggering cases of false sharing
+ if (endpoint == lastUsedEndpoint && endpoint.isSingletonProducer()) {
+ return lastUsedProducer;
+ }
+
try {
AsyncProducer producer = producers.acquire(endpoint);
if (statistics != null) {
statistics.onHit(endpoint.getEndpointUri());
}
+ lastUsedEndpoint = endpoint;
Review Comment:
Thanks for pointing this out. I've made change ...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]