[PATCH 2/2] Initialize tunable list with the GLIBC_TUNABLES environment variable

Siddhesh Poyarekar sid@reserved-bit.com
Wed Jan 13 03:27:00 GMT 2016


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



More information about the Libc-alpha mailing list