From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/7680 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Deduplicating atomics written in terms of CAS Date: Mon, 18 May 2015 12:19:34 +0200 Message-ID: <20150518101933.GD11258@port70.net> References: <20150517045536.GA25046@brightrain.aerifal.cx> <20150517061430.GL17573@brightrain.aerifal.cx> <1431848239.11628.3.camel@inria.fr> <20150517162854.GN17573@brightrain.aerifal.cx> <1431881993.4219.1.camel@inria.fr> <20150517175918.GQ17573@brightrain.aerifal.cx> <1431901387.4219.7.camel@inria.fr> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1431944391 19550 80.91.229.3 (18 May 2015 10:19:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 18 May 2015 10:19:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-7692-gllmg-musl=m.gmane.org@lists.openwall.com Mon May 18 12:19:49 2015 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1YuI9D-0007EM-An for gllmg-musl@m.gmane.org; Mon, 18 May 2015 12:19:47 +0200 Original-Received: (qmail 17423 invoked by uid 550); 18 May 2015 10:19:46 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 16381 invoked from network); 18 May 2015 10:19:45 -0000 Mail-Followup-To: musl@lists.openwall.com Content-Disposition: inline In-Reply-To: <1431901387.4219.7.camel@inria.fr> User-Agent: Mutt/1.5.23 (2014-03-12) Xref: news.gmane.org gmane.linux.lib.musl.general:7680 Archived-At: * 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)