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: [RFC] Should we declare errno with __thread on x86?


On Fri, Mar 18, 2016 at 7:14 PM, Roland McGrath <roland@hack.frob.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.

zw


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