public inbox for
 help / color / mirror / Atom feed
From: Iain Sandoe <>
To: Jonathan Wakely <>
Subject: Re: [RFA/C] Reimplementation of std::call_once.
Date: Wed, 9 Aug 2023 14:12:43 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

> On 9 Aug 2023, at 13:53, Jonathan Wakely <> wrote:
> On Wed, 9 Aug 2023 at 13:51, Iain Sandoe <> wrote:
>>> On 9 Aug 2023, at 13:38, Jonathan Wakely <> wrote:
>>> On Wed, 9 Aug 2023 at 13:22, Iain Sandoe <> wrote:
>>>> =====
>>>> the implementation in can sit togethe with the old version so that the symbols for that remain available (or, for versioned libraries, the old code can be deleted).
>>> If you have old and new code sharing a std::once_flag object you're dead.
>> indeed - I was only considering the case where existing binaries needed to run with the new lib, not the case where code compiled with two different impls was combined.
>>> Something like the abi_tag transition for std::string in GCC 5 would be needed.
>> That sounds quite complicated and likely to produce similar pain?
> Not nearly as complicated (since we don't use std::call_once
> throughout the entire library) but it would still cause pain for the
> ecosystem.

I was, at one stage, considering the idea of [the new impl] copying the trampoline lambda address to the (old) => __once_call and the closure address to (old) __once_callable and then amending __once_proxy to handle this.

It would still be broken w.r.t. nested call_once cases, but no more broken than existing.

However, that means lying about the signature of the old __once_call.

.. and it does not solve the issue that the size of the once_flag has changed.

>> ====
>> Presumably an alternative is that I just have to accept that Darwin needs to use a versioned library (which is a direction I am close to heading in because of co-existence of mulitple c++ runtimes anyway).
> We do need to fix PR 99341 somehow, I just don't know how.

yeah, tricky.

that PR shows as closed, FWIW - but as noted at the start I think x86_64-linux-gnu is also broken w.r.t once-called fns throwing


  reply	other threads:[~2023-08-09 13:12 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 12:21 Iain Sandoe
2023-08-09 12:38 ` Jonathan Wakely
2023-08-09 12:51   ` Iain Sandoe
2023-08-09 12:53     ` Jonathan Wakely
2023-08-09 13:12       ` Iain Sandoe [this message]
2023-08-09 14:10         ` Jonathan Wakely

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).