arunpandianp commented on code in PR #33687:
URL: https://github.com/apache/beam/pull/33687#discussion_r1926266354
##########
runners/google-cloud-dataflow-java/worker/src/main/java/org/apache/beam/runners/dataflow/worker/util/BoundedQueueExecutor.java:
##########
@@ -235,10 +241,32 @@ private void executeMonitorHeld(Runnable work, long
workBytes) {
}
private void decrementCounters(long workBytes) {
- monitor.enter();
- --elementsOutstanding;
- bytesOutstanding -= workBytes;
- monitor.leave();
+ // All threads queue decrements and one thread grabs the monitor and
updates
+ // counters. We do this to reduce contention on monitor which is locked by
+ // GetWork thread
+ decrementQueue.add(workBytes);
Review Comment:
I think keeping the queue is simpler than packing both values into an atomic
+ overflow checking. The queue should contain only one element per harness
thread. Let's keep the queue.
--
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]