mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Jens Gustedt <jens.gustedt@inria.fr>
Cc: musl@lists.openwall.com
Subject: Re: move to a proper __lock_t type
Date: Thu, 6 Jul 2017 16:33:20 +0200	[thread overview]
Message-ID: <20170706163320.104c9d05@inria.fr> (raw)
In-Reply-To: <20170705214150.GB1627@brightrain.aerifal.cx>

[-- Attachment #1: Type: text/plain, Size: 1496 bytes --]

Hello,

On Wed, 5 Jul 2017 17:41:50 -0400 Rich Felker <dalias@libc.org> wrote:

> One minor concern: if we do make it a struct type, there are possibly
> formal aliasing issues with having it embedded in any of the public
> pthread types (cond vars, maybe barriers?) without a public
> definition. Perhaps it should be an int array typedef (length 1) or
> just a typedef'd int?

Right, I already have looked into cond vars and have a patch for
that. At the time we were doing the C11 thrd stuff, we already
discussed that, and in fact I think now would be the time to have that
improved, too. The current implementation there, is already somewhat
similar in strategy to the new algorithm.

Hm, this would again imply that we wouldn't be able to stick a
volatile into the type, and so we would even loose the volatile that
we have now for all the "lock" variables.

So, I would go for

typedef volatile int __lock_t[1];

after you merged the new algorithm.

For cond variables the __lock/__unlock interfaces then would still
"work", modulo the problem that the underlying int is not a veritable
volatile. But that is the situation for this code now, anyhow.

Jens

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

[-- Attachment #2: Digitale Signatur von OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

      reply	other threads:[~2017-07-06 14:33 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-24  9:54 [PATCH] missing volatile in __get_locale Jens Gustedt
2017-07-04 22:22 ` Rich Felker
2017-07-04 22:24   ` Alexander Monakov
2017-07-04 22:28     ` Rich Felker
2017-07-05  6:30       ` move to a proper __lock_t type Jens Gustedt
2017-07-05 16:07         ` Rich Felker
2017-07-05 20:53           ` Jens Gustedt
2017-07-05 21:41             ` Rich Felker
2017-07-06 14:33               ` Jens Gustedt [this message]

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=20170706163320.104c9d05@inria.fr \
    --to=jens.gustedt@inria.fr \
    --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).