This is the mail archive of the
mailing list for the GCC project.
Re: Thread-safe profiling
On Mar 15, 2007, at 4:24 PM, Ian Lance Taylor wrote:
Jan Hubicka <email@example.com> writes:The current code use 64 bits counters. Non atomic increment on 32
bits platform may produce weird result
Trying to imagine what random user would find more discourgrating
longer train runs (still probably quite shorter than in ICC) or weird
looking mismatches and/or wrong resulting profile, I guess the
lesser evil and easier to analyze.
It seems to me that the alternative to thread-safe profiling should
just be that some nodes are undercounted, when two threads try to
update the count simultaneously. It shouldn't be wildly wrong, just
(ie jumping from 0xfffffffe to 0).
Are 32 bits counters too short ?
Also, for coverage we are thinking about a 1 byte (atomic) flag.
Setting it to 1 shouldn't be racy.