This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Async-signal-safe access to __thread variables from dlopen()ed libraries?
- From: Rich Felker <dalias at aerifal dot cx>
- To: Andrew Hunter <ahh at google dot com>
- Cc: Carlos O'Donell <carlos at redhat dot com>, Ian Lance Taylor <iant at google dot com>, Paul Pluzhnikov <ppluzhnikov at google dot com>, Roland McGrath <roland at hack dot frob dot com>, Richard Henderson <rth at twiddle dot net>, GNU C Library <libc-alpha at sourceware dot org>, Alexandre Oliva <aoliva at redhat dot com>
- Date: Tue, 24 Sep 2013 18:24:00 -0400
- Subject: Re: Async-signal-safe access to __thread variables from dlopen()ed libraries?
- Authentication-results: sourceware.org; auth=none
- References: <523BD470 dot 6090203 at redhat dot com> <CAKOQZ8y85QBkd97cEEmP-4OgE2KizCqknrVR_n44pwBGMs5uAw at mail dot gmail dot com> <523C88D1 dot 6090304 at redhat dot com> <CAKOQZ8ze1zKdQRsMsmBCqnJr361Gvv8mYjLjGgzYwWJEKUY+7w at mail dot gmail dot com> <523CB72A dot 7040507 at redhat dot com> <CAKOQZ8yq6gnWig3Wg4YF0qOYTJbevEExG0Sm9K4ofsSO+PWq1A at mail dot gmail dot com> <5241F2CF dot 9020004 at redhat dot com> <CADroS=712-dg+bwR-HY9mYNFPSU=oZekwUJaA8dRqs1-o=-qcQ at mail dot gmail dot com> <5242036A dot 8020004 at redhat dot com> <CADroS=5hAnZwv168EHS36-oXuptjGrHTFyyxPdSHgdcQmUeL+Q at mail dot gmail dot com>
On Tue, Sep 24, 2013 at 02:40:13PM -0700, Andrew Hunter wrote:
> FYI, on my recent-ish Intel system, a mask/unmask pair is under 350
> nanoseconds. The block times aren't likely to be much longer; the
> most expensive thing done there is (at most) two small mmaps (if we
> don't override with a better malloc.) mmap'ing a page and populating
> it costs <2 microseconds on my system. I would be very surprised,
> other than in very large TLS arrays or very strange circumstances, if
> tls_get_addr() took more than a millisecond on CPU.
I would be surprised if it ever took more than 5 microseconds. For
what it's worth, millisecond latency is serious and could be
considered a problem for many realtime uses. Microsecond, not so much.
Rich