This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH][BZ #19329] Fix race between tls allocation at thread creation and dlopen
- From: Torvald Riegel <triegel at redhat dot com>
- To: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Cc: Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, libc-alpha at sourceware dot org, nd at arm dot com
- Date: Thu, 21 Jan 2016 22:03:03 +0100
- Subject: Re: [PATCH][BZ #19329] Fix race between tls allocation at thread creation and dlopen
- Authentication-results: sourceware.org; auth=none
- References: <568D5E11 dot 3010301 at arm dot com> <5693D908 dot 8090104 at arm dot com> <5695B7BF dot 7050000 at redhat dot com> <5697BA1F dot 6010801 at arm dot com> <569D282E dot 8000005 at linaro dot org> <569D466F dot 50902 at arm dot com>
On Mon, 2016-01-18 at 20:09 +0000, Szabolcs Nagy wrote:
> of course using both atomics and locks is a bit
> ugly..
Not necessarily. If it works and makes sense otherwise, I would not
advice against it. Some problems are easier to solve with locks, some
not. Mixing them isn't usually a big problem, if one follows some
rules. For example, if you access something with atomics, access it
with atomics everywhere, including in the critical sections.