Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 18 May 2015 13:03:30 +0200
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: Re: Deduplicating atomics written in terms of CAS

Am Montag, den 18.05.2015, 12:19 +0200 schrieb Szabolcs Nagy:
> * Jens Gustedt <jens.gustedt@...ia.fr> [2015-05-18 00:23:07 +0200]:
> > 
> > The advantage of C11's model for atomic is that this a qualifier, and
> > then the compiler automatically checks (or ensures) that all accesses
> > are atomic. We don't have that luxury, here, but we could get a bit
> > closer to it.
> > 
> 
> the qualifierness of atomic is a bit confusing
> 
> differently qualified types had the same alignment and representation
> so far and in some cases pointers to differently qualified types are
> implicitly convertible (eg assigning char* to const char* is ok).
> 
> atomic is special: when the standard says 'qualified or unqualified type'
> it does not include _Atomic even though it is called a qualifier.
> (atomic is always mentioned explicitly, it can have different representation
> and alignment to allow implementation with locks and thus the pointers
> cannot be convertible)
> 
> annotating everything with _Atomic in musl is problematic because the
> atomic bits are publicly visible in pthread types (we could use _Atomic
> only when building musl, but i think its usefulness should be demonstrated
> with examples etc before doing something that ugly.. having a_load_relaxed
> without typesystem help does not sound very useful)

I didn't say that I wanted to use _Atomic, we can't do that for
obvious reasons. I just want to hide the atomic objects behind a
typedef, such that production compiles generate exactly the same
binary, but that we also can use the compiler to have a check for
consistency.

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 ::




Download attachment "signature.asc" of type "application/pgp-signature" (182 bytes)

Powered by blists - more mailing lists

Your e-mail address:

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