This is the mail archive of the
mailing list for the glibc project.
Re: [RFC] Should we declare errno with __thread on x86?
- From: Zack Weinberg <zackw at panix dot com>
- To: Roland McGrath <roland at hack dot frob dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Tue, 12 Apr 2016 15:34:59 -0400
- Subject: Re: [RFC] Should we declare errno with __thread on x86?
- Authentication-results: sourceware.org; auth=none
- References: <CAMe9rOrb8XPsTUKHMw7F-+iy7D=UH=5XP_K06wDAwka+RRDCgw at mail dot gmail dot com> <20160318231420 dot A1C7E2C3C66 at topped-with-meat dot com>
On Fri, Mar 18, 2016 at 7:14 PM, Roland McGrath <email@example.com> wrote:
> Since what you are suggesting is a change motivated solely by performance,
> we should see some real-world or benchmark measurements of some kind to
> justify it. A micro-benchmark of reading errno is not that interesting,
> especially since naive intuition would expect that errno is examined only
> (or almost entirely) in error paths that are not hot paths and so that
> same intuition would expect that real-world impact would be negligible.
Also, even when errno is accessed in a tight loop in real code (e.g.
parsing a bunch of numbers with strtol-family functions), gcc (tested
as far back as 4.8) is able to hoist the call to __errno_location out
of the loop, probably due to the __attribute__((const)) annotation.