So I am using ThreadSanitizer, and I find myself cleaning up data races that don't matter, in order to keep the output clean. (For example, an atomic set of a flag, where another thread reads that flag word, but doesn't care about that flag). On the one hand,
-
-
Oh. My read is non-atomic, which is in fact okay on these CPUs, but tsan doesn’t care. But it’s the same design issue either way — to fix that, I don’t want to slow down all reads of the flag word with atomics, so I would break it into a different word anyway.
-
I may be wrong, but wouldn't it be better to move your non-atomic flags to a separate cache line (from the atomic ones) so that writes from another core don't trigger a cache flush of your non-atomic flags, too?
- Još 2 druga odgovora
Novi razgovor -
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.