Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 18 May 2023 16:01:18 +0200
From: Jₑₙₛ Gustedt <jens.gustedt@...ia.fr>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com, 847567161 <847567161@...com>
Subject: Re: Question:Why musl call a_barrier in
 __pthread_once?

Rich,

on Thu, 18 May 2023 09:29:05 -0400 you (Rich Felker <dalias@...c.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 ::

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.