[PATCH][malloc] Avoid atomics in have_fastchunks
DJ Delorie
dj@redhat.com
Tue Sep 19 17:42:00 GMT 2017
"Carlos O'Donell" <carlos@redhat.com> writes:
> You use unadorned loads and stores of the variable av->have_fastchunks, and
> this constitutes a data race which is undefined behaviour in C11.
I think the key here is to look at all accesses to that variable, and
consider "what's the worst that could happen if the wrong value is there
forever". If the worst case doesn't counter the benefits, it's a net
win.
Buy my biggest concern is wondering how long a "wrong value" can persist
and cause problems.
More information about the Libc-alpha
mailing list