From: "Jₑₙₛ Gustedt" <jens.gustedt@inria.fr>
To: Rich Felker <dalias@libc.org>
Cc: musl@lists.openwall.com, 847567161 <847567161@qq.com>
Subject: Re: [musl] Question:Why musl call a_barrier in __pthread_once?
Date: Thu, 18 May 2023 16:01:18 +0200 [thread overview]
Message-ID: <20230518160118.231a1585@inria.fr> (raw)
In-Reply-To: <20230518132905.GP4163@brightrain.aerifal.cx>
[-- Attachment #1: Type: text/plain, Size: 1448 bytes --]
Rich,
on Thu, 18 May 2023 09:29:05 -0400 you (Rich Felker <dalias@libc.org>)
wrote:
> Of course call_once is exempt from any such requirements
it was, but isn't anymore. In C23, now we have
Completion of an effective call to the `call_once` function
synchronizes with all subsequent calls to the `call_once` function
with the same value of `flag`.
POSIX (for which the ISO 9945 instantiation is currently at NB ballot)
also has updated all of this
The pthread_once() and call_once() functions shall synchronize
memory for the first successful call in each thread for a given
pthread_once_t or once_flag object, respectively. If the
init_routine called by pthread_once() or call_once() is a
cancellation point and is canceled, a successful call to
pthread_once() for the same pthread_once_t object or to
call_once() for the same once_flag object, made from a
cancellation cleanup handler shall also synchronize memory.
If I understand this correctly, the C11 interfaces become mandatory if
the platform supports threads.
Thanks
Jₑₙₛ
--
:: ICube :::::::::::::::::::::::::::::: deputy director ::
:: Université de Strasbourg :::::::::::::::::::::: ICPS ::
:: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus ::
:: :::::::::::::::::::::::::::::::::::: ☎ +33 368854536 ::
:: https://icube-icps.unistra.fr/index.php/Jens_Gustedt ::
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 195 bytes --]
next prev parent reply other threads:[~2023-05-18 14:01 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-18 2:49 =?gb18030?B?UmU6IFJlOiBbbXVzbF0gUXVlc3Rpb26juldoeSBtdXNsIGNhbGwgYV9iYXJyaWVyIGluIF9fcHRocmVhZF9vbmNlPw==?= =?gb18030?B?ODQ3NTY3MTYx?=
2023-05-18 12:23 ` Re: [musl] Question:Why musl call a_barrier in __pthread_once? Szabolcs Nagy
2023-05-18 13:29 ` Rich Felker
2023-05-18 14:01 ` Jₑₙₛ Gustedt [this message]
2023-05-18 14:08 ` Rich Felker
2023-05-18 14:15 ` Jeffrey Walton
2023-05-18 14:20 ` Rich Felker
-- strict thread matches above, loose matches on Subject: below --
2023-05-17 10:07 [musl] =?gb18030?B?UXVlc3Rpb26juldoeSBtdXNsIGNhbGyBMIQyYV9iYXJyaWVyIGluIF9fcHRocmVhZF9vbmNlPw==?= =?gb18030?B?ODQ3NTY3MTYx?=
2023-05-17 10:37 ` [musl] Question:Why musl call a_barrier in __pthread_once? alice
2023-05-17 11:17 ` NRK
2023-05-17 13:12 ` Rich Felker
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230518160118.231a1585@inria.fr \
--to=jens.gustedt@inria.fr \
--cc=847567161@qq.com \
--cc=dalias@libc.org \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
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 NNTP newsgroup(s).