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

Am Sonntag, den 17.05.2015, 18:33 -0400 schrieb Rich Felker:
> On Mon, May 18, 2015 at 12:23:07AM +0200, Jens Gustedt wrote:
> > Am Sonntag, den 17.05.2015, 13:59 -0400 schrieb Rich Felker:
> > > > Ah sorry, I probably went too fast. My last paragraph would be for all
> > > > atomic operations, so in particular 32 bit. A macro "a_load" would
> > > > make intentions clearer and would perhaps allow to implement an
> > > > optional compile time check to see if we use any object consistently
> > > > as atomic or not.
> > > 
> > > The reason I'm mildly against this is that all current reads of
> > > atomics, except via the return value of a_cas or a_fetch_add, are
> > > relaxed-order. We don't care if we see a stale value; if staleness
> > > could be a problem, the caller takes care of that in an efficient way.
> > > Having a_load that's relaxed-order whereas all the existing atomics
> > > are seq_cst order would be an inconsistent API design.
> > 
> > I still wasn't clear enough, sorry. My idea was not that such a
> > function or macro should change anything on the binary code that is
> > produced, at least for production builds. I just thought to
> > encapsulate all atomic accesses into a type and functions that allow
> > to have a compile check.
> 
> I understand that. But if it were called a_load, its semantics (no
> synchronization/relaxed order) would be inconsistent with all other
> a_* atomics which are seq_cst. That's what I don't like.

Right. So call it a_load_rel, or something similar?

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.