NO_TLS flag for public headers

David Chisnall theraven at FreeBSD.org
Wed Feb 8 14:51:48 UTC 2012


Hi,

The xlocale changes in libc mean that a lot of things that were previously global state are now per-thread.  This includes some things that were used in ctype.h and are inlined.  We're now losing the benefit of inlining them because we now have to call into libc to get the per-thread values.  I'd like to use TLS for caching these things, but we currently have no equivalent of the NO_TLS flag for public headers.  I'd like to have a __NO_TLS that can be set in cdefs.h for architectures that don't have TLS support.

Any comments?  Objections?  Anyone want to propose a better place for it (or, indeed, add it, since I'm not entirely sure which architectures do lack TLS support...)

David


More information about the freebsd-arch mailing list