You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The current state of the art thread sanitizer machinery is not capable of handling thread fences decoupled from atomic operations. And as a multi-threaded system, Jolt surely needs to be testable with TSAN (without getting false-positives due to thread fences being skipped).
Jolt uses atomic_thread_fences in two places, JobSystem.h (Job::Release) and Reference.h (RefTarget::Release). In both places, replacing them with an acq_rel fetch_sub would be (pretty much) semantically equivalent and testable with TSAN, but result in worse codegen on ARM on the hot path (yes, I checked it).
Hence, dirty ifdefs for TSAN builds seem like the only way to go here. I can do a PR if this idea is approved.
The text was updated successfully, but these errors were encountered:
I tried making TSAN work in the (distant) past and couldn't get it to work. If you think you can make it work then yes please make a PR (make sure that it is part of the github build action and runs the unit tests)!
@jrouwe we are already successfully running autotests that use Jolt w/ TSAN, but after manually trying to run it on a fresh Ubuntu setup I have noticed that GCC complains about thread fences (and rightly so). Alright, I'll do a PR sometime around this week.
The current state of the art thread sanitizer machinery is not capable of handling thread fences decoupled from atomic operations. And as a multi-threaded system, Jolt surely needs to be testable with TSAN (without getting false-positives due to thread fences being skipped).
Jolt uses atomic_thread_fences in two places, JobSystem.h (Job::Release) and Reference.h (RefTarget::Release). In both places, replacing them with an acq_rel fetch_sub would be (pretty much) semantically equivalent and testable with TSAN, but result in worse codegen on ARM on the hot path (yes, I checked it).
Hence, dirty ifdefs for TSAN builds seem like the only way to go here. I can do a PR if this idea is approved.
The text was updated successfully, but these errors were encountered: