This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: __libc_single_threaded variable for optimizing std::shared_ptr (was: [PATCH, AArch64 00/11] LSE atomics out-of-line)
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: rth7680 at gmail dot com, gcc-patches at gcc dot gnu dot org, ramana dot radhakrishnan at arm dot com, agraf at suse dot de, matz at suse dot de, Richard Henderson <richard dot henderson at linaro dot org>, libstdc++ at gcc dot gnu dot org
- Date: Mon, 4 Feb 2019 12:15:41 +0000
- Subject: Re: __libc_single_threaded variable for optimizing std::shared_ptr (was: [PATCH, AArch64 00/11] LSE atomics out-of-line)
- References: <20180926050355.32746-1-richard.henderson@linaro.org> <871s4nu7po.fsf@oldenburg2.str.redhat.com>
On 04/02/19 12:13 +0100, Florian Weimer wrote:
* Richard Henderson:
Therefore, I've created small out-of-line helpers that are directly
linked into every library or executable that requires them. There
will be two direct branches, both of which will be well-predicted.
This work inspired me to put together something that provides a similar
hidden variable, comparable to __aa64_have_atomics, to libc_nonshared.a
in glibc:
<https://sourceware.org/ml/libc-alpha/2019-02/msg00073.html>
I hope it can be eventually be used to dynamically optimize the use of
atomics in the std::shared_ptr implementation in libstdc++.
This makes me very happy. Thanks, Florian!
For a generic optimization of all atomics, this is not suitable because
even a single-threaded process can have MAP_SHARED mappings and will
have to use atomics there.
Thanks,
Florian