Thread-local support for non-POD data objects
Siddhesh Poyarekar
siddhesh.poyarekar@gmail.com
Thu Aug 1 05:18:00 GMT 2013
On 1 August 2013 09:19, Rich Felker <dalias@aerifal.cx> wrote:
> Since this is a new feature, my feeling is we should try to get it
> right. There should be some way for the dynamic linker to know the
> maximum number of __cxa_thread_atexit calls the library will make so
> it can reserve space for them. Fixing plain __cxa_atexit can be a
> separate issue.
The way it is currently implemented, any fix that happens for this
could be done for both __cxa_atexit and __cxa_thread_atexit. The
feature is already out with gcc-4.8, so major design changes may be
difficult to make at this stage. Maybe you could talk to the gcc
folks and see if this is possible.
> How many calls to __cxa_atexit does the compiler generate? Offhand it
> looks like it generates one per object, which is really ugly and
> inefficient; there's no reason for it to be more than one per
> translation unit, and it could really be just one per dso with some
> toolchain help, or even better, none at all, using fini_array instead.
It uses the init_array/fini_array currently for __cxa_atexit, but it
is still one call per object I think.
Siddhesh
--
http://siddhesh.in
More information about the Libc-alpha
mailing list