[PATCH] #13594: Avoid race in nscd

Carlos O'Donell carlos@systemhalted.org
Tue May 15 20:36:00 GMT 2012


On Mon, May 14, 2012 at 5:26 PM, Roland McGrath <roland@hack.frob.com> wrote:
>> > Why are we rolling a bespoke pthread_spin_lock()?
>> >
>> > If we have threads, why aren't we using the pthreads interface?
>>
>> The handle is already in the code and used this way, so we're compatible.
>
> There may be just some hysterical raisins here.  But the important thing to
> note is that this is a shared-memory area shared between nscd itself and
> arbitrary programs using libc.  The latter might not have any pthread code,
> so for name space reasons if nothing else it couldn't literally use
> pthread_spin_lock.
>
> But more generally, the nscd shared-memory area is in effect another ABI
> surface.  So everything that makes it more straightforwardly self-contained
> simplifies the potential compatibility issues.

Ah! That makes sense. Thanks.

Cheers,
Carlos.



More information about the Libc-alpha mailing list