Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 18 May 2015 12:19:34 +0200
From: Szabolcs Nagy <>
Subject: Re: Deduplicating atomics written in terms of CAS

* Jens Gustedt <> [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)

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.