TSan: Fix data race of updating current time#9168
TSan: Fix data race of updating current time#9168masaori335 wants to merge 1 commit intoapache:masterfrom
Conversation
19640f1 to
eed8bae
Compare
| Thread(); | ||
|
|
||
| static ink_hrtime cur_time; | ||
| static std::atomic<ink_hrtime> cur_time; |
There was a problem hiding this comment.
Thread::cur_time is shared across threads.
trafficserver/iocore/eventsystem/I_Thread.h
Lines 159 to 160 in a5f647a
|
@masaori335 agreed to do some performance testing of this patch compared to using |
My very basic benchmark says Anyway, both of them need around 20ns. It still makes sense to have a cache for frequent access.
Performance perspective, thread local seems better (#9184) because it shares nothing. |
|
This pull request has been automatically marked as stale because it has not had recent activity. Marking it stale to flag it for further consideration by the community. |
Fix below TSan report.