[RFC] Should we declare errno with __thread on x86?
Zack Weinberg
zackw@panix.com
Tue Apr 12 19:35:00 GMT 2016
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
More information about the Libc-alpha
mailing list