mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Szabolcs Nagy <nsz@port70.net>
To: 847567161 <847567161@qq.com>
Cc: musl <musl@lists.openwall.com>
Subject: Re: [musl] Re:Re: Re: [musl] Question:Why musl call a_barrier in __pthread_once?
Date: Thu, 18 May 2023 16:55:29 +0200	[thread overview]
Message-ID: <20230518145529.GW3630668@port70.net> (raw)
In-Reply-To: <tencent_BA6EF0C4ED071F0A173FBBC169C4F3E4B10A@qq.com>

* 847567161 <847567161@qq.com> [2023-05-18 22:37:06 +0800]:
> &gt;  writes in init may not be visible when *control==2, without
> &gt;  the barrier. (there are many explanations on the web why
> &gt;  double-checked locking is wrong without an acquire barrier,
> &gt;  that's the same issue if you are interested in the details)
> 
> yes, can you show me the web?

https://preshing.com/20130930/double-checked-locking-is-fixed-in-cpp11/

this links to papers that explain why you need the barrier
in the fast path.

  reply	other threads:[~2023-05-18 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18 14:37 [musl] =?gb18030?B?UmU6UmU6IFJlOiBbbXVzbF0gUXVlc3Rpb26juldoeSBtdXNsIGNhbGwgYV9iYXJyaWVyIGluIF9fcHRocmVhZF9vbmNlPw==?= =?gb18030?B?ODQ3NTY3MTYx?=
2023-05-18 14:55 ` Szabolcs Nagy [this message]
2023-05-21 19:16 ` [musl] Re:Re: Re: [musl] Question:Why musl call a_barrier in __pthread_once? Markus Wichmann
2023-05-22  1:53 [musl] =?gb18030?B?UmU6UmU6IFJlOiBbbXVzbF0gUXVlc3Rpb26juldoeSBtdXNsIGNhbGwgYV9iYXJyaWVyIGluIF9fcHRocmVhZF9vbmNlPw==?= =?gb18030?B?ODQ3NTY3MTYx?=
2023-05-23 19:41 ` [musl] Re:Re: Re: [musl] Question:Why musl call a_barrier in __pthread_once? Szabolcs Nagy

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=20230518145529.GW3630668@port70.net \
    --to=nsz@port70.net \
    --cc=847567161@qq.com \
    --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).