Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c > #96409

Re: compound assignment to atomic type

From Ben Bacarisse <ben.usenet@bsb.me.uk>
Newsgroups comp.lang.c
Subject Re: compound assignment to atomic type
Date 2016-11-12 11:06 +0000
Organization A noiseless patient Spider
Message-ID <87wpg9lzxr.fsf@bsb.me.uk> (permalink)
References <c023fb24-93f5-463d-8618-e19499f78f0a@googlegroups.com> <8737iyovea.fsf@bsb.me.uk> <a78d7205-33d3-48d1-bf53-a928e042bdcc@googlegroups.com>

Show all headers | View raw


spacewar@gmail.com writes:

> On Friday, November 11, 2016 at 9:04:38 AM UTC-7, Ben Bacarisse wrote:
>> This came up in a DR about the use of various terms relating to atomic
>> types and atomic operations:
>> 
>> http://www.open-std.org/jtc1/sc22/wg14/www/docs/summary.htm#dr_486
>
>> The DR is under review, but I get the feeling the committee agrees that
>> the wording is confusing.  I think you can rely on x <op>= y having the
>> RMW sematics described in 6.5.16.2 (along with the extensive footnote
>> 113).
>
> Thanks!  I'm rather unimpressed with the committee's statement that it
> "does not feel that this DR is 'actionable'", and that they apparently
> don't want to address the issues in a Technical Corrigendum. I don't
> see the outright contradiction between §6.5.16.2 ¶3 and §7.17.7.5 ¶5
> as a "small inconsistency".

I don't see the wording as an outright contradiction.  The problem comes
down to what atomic means, and the depends on the observer.  x += y is
atomic to an observer in C, but not (I think[1]) to an observer of
volatile accesses.  The functions of 7.17.7.5 are (again, I think)
atomic to all but a hardware observer.

[1] I'm not an expert in this.  I'd welcome a technical discussion of
C's atomic primitives because I either don't understand them properly or
there are other rough edges to the description of them.

-- 
Ben.

Back to comp.lang.c | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

compound assignment to atomic type spacewar@gmail.com - 2016-11-10 19:34 -0800
  Re: compound assignment to atomic type Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-11-11 16:04 +0000
    Re: compound assignment to atomic type supercat@casperkitty.com - 2016-11-11 09:01 -0800
      Re: compound assignment to atomic type Tim Rentsch <txr@alumni.caltech.edu> - 2016-11-15 10:54 -0800
    Re: compound assignment to atomic type spacewar@gmail.com - 2016-11-12 00:48 -0800
      Re: compound assignment to atomic type Ben Bacarisse <ben.usenet@bsb.me.uk> - 2016-11-12 11:06 +0000
        Re: compound assignment to atomic type supercat <flatfinger@casperkitty.com> - 2016-11-12 11:03 -0800
        Re: compound assignment to atomic type Tim Rentsch <txr@alumni.caltech.edu> - 2016-11-13 10:57 -0800
      Re: compound assignment to atomic type Tim Rentsch <txr@alumni.caltech.edu> - 2016-11-13 10:31 -0800
  Re: compound assignment to atomic type "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-12 11:24 -0800
    Re: compound assignment to atomic type Tim Rentsch <txr@alumni.caltech.edu> - 2016-11-13 10:59 -0800
      Re: compound assignment to atomic type "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-13 17:34 -0800
        Re: compound assignment to atomic type "Chris M. Thomasson" <invalid@invalid.invalid> - 2016-11-13 17:48 -0800
        Re: compound assignment to atomic type Tim Rentsch <txr@alumni.caltech.edu> - 2016-11-15 10:42 -0800

csiph-web