I did some local hacking of thread_sanitizer.cc and it turns out we need to do
full-VTS comparison only in NewSegmentForWait().
In all other places we can just compare the current VTS with a TID/clock of the
"old" Segment.
On the slow path this can be done in O(log N) instead of O(N+M) time.
This may speed up TSan a little bit, but we don't expect a significant
difference since HappensBefore is already cached (i.e. amortized O(1) on the
fast path).
However, if we get rid of the optimization requiring HappensBefore() call in
the NewSegmentForWait() we may drop VTSes from the Segments and this would save
us a lot of space.
Ideas?
Original issue reported on code.google.com by timurrrr on 3 Jun 2011 at 12:05
Original issue reported on code.google.com by
timurrrr
on 3 Jun 2011 at 12:05