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 2/2] Initialize tunable list with the GLIBC_TUNABLES environment variable


On Tue, Jan 12, 2016 at 09:44:51PM -0500, Carlos O'Donell wrote:
> Not true if you link statically and dlopen, at which point you could
> have multiple threads, and you call dlopen which loads 
> libc.so/libpthread.so's constructors?

A single load (and constructor call) does not matter since there's
nothing to race against.  The case of concurrent constructor calls I
mentioned in the following paragraph; the load lock is sufficient to
protect it.

> > Even in case the constructors do get called in parallel in different
> > threads, they should get synchronized by the dynamic linker load lock,
> > so you'd never have concurrent calls to __tunables_init that race on
> > the value of initialized.
> 
> Please include a concurrency note there then, that this is protected
> by the load lock?

OK.

Thanks,
Siddhesh


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