This is an archive of the discontinued LLVM Phabricator instance.

tsan: use semaphores for thread creation synchronization
ClosedPublic

Authored by dvyukov on Aug 3 2021, 3:50 AM.

Details

Summary

We currently use ad-hoc spin waiting to synchronize thread creation
and thread start both ways. But spinning tend to degrade ungracefully
under high contention (lots of threads are created at the same time).
Use semaphores for synchronization instead.

Diff Detail

Event Timeline

dvyukov created this revision.Aug 3 2021, 3:50 AM
dvyukov requested review of this revision.Aug 3 2021, 3:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 3 2021, 3:50 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
dvyukov updated this revision to Diff 363681.Aug 3 2021, 3:53 AM

don't leave p.tid uninitialized

melver accepted this revision.Aug 3 2021, 4:16 AM
This revision is now accepted and ready to land.Aug 3 2021, 4:16 AM
This revision was automatically updated to reflect the committed changes.