sjvanrossum commented on PR #39458:
URL: https://github.com/apache/beam/pull/39458#issuecomment-5127473277

   Actually, it looks like `MoreFutures.runAsync(ThrowingRunnable)` submits 
onto the common `ForkJoinPool` and apparently it does not establish a 
happens-before relationship between the submitting thread and the executing 
thread.
   What _is_ described is that calling `join()` on a `ForkJoinTask` establishes 
a happens-before relationship between the executing thread and the joining 
thread.
   Intuitively, I would assume that the same would hold true for 
submitting/forking threads. I can see why that might not be the case in some 
circumstances, but I haven't found any reason for it in the documentation (yet).
   
   The `ScheduledExecutorService` provided by the harness does establish a 
happens-before relationship between the submitting and executing threads. My 
guess is that this isn't what `ForkJoinPool` is meant for, so I've replaced it 
with the harness `ScheduledExecutorService` in #39556 which also resolved the 
TSAN bugs you observed.
   


-- 
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]

Reply via email to