This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH][malloc] Avoid atomics in have_fastchunks


"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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]