Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Semantics of some std::atomic<iType> member functions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
Scott Meyers  
View profile   Translate to Translated (View Original)
 More options 3 Nov, 18:07
Newsgroups: comp.std.c++
From: Scott Meyers <use...@aristeia.com>
Date: Tue, 3 Nov 2009 12:07:46 CST
Local: Tues 3 Nov 2009 18:07
Subject: Semantics of some std::atomic<iType> member functions
29.5.1 in N2960 declares the following member functions for std::atomic_itype:

integral operator+=(integral) volatile;
integral operator-=(integral) volatile;
integral operator&=(integral) volatile;
integral operator|=(integral) volatile;
integral operator^=(integral) volatile;

Some of these are also declared for std::atomic_address and std::atomic<T*>.
But I can't find any description of their semantics including, rather
critically, whether they are atomic operations.  Am I overlooking semantic
descriptions somewhere?

Thanks,

Scott

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-...@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Pete Becker  
View profile   Translate to Translated (View Original)
 More options 3 Nov, 23:08
Newsgroups: comp.std.c++
From: Pete Becker <p...@versatilecoding.com>
Date: Tue, 3 Nov 2009 17:08:18 CST
Local: Tues 3 Nov 2009 23:08
Subject: Re: Semantics of some std::atomic<iType> member functions

[atomics.types.operations]/26

--
    Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com) Author of
"The Standard C++ Library Extensions: a Tutorial and Reference"
(www.petebecker.com/tr1book)

[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-...@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anthony Williams  
View profile   Translate to Translated (View Original)
 More options 3 Nov, 23:10
Newsgroups: comp.std.c++
From: Anthony Williams <anthony....@gmail.com>
Date: Tue, 3 Nov 2009 17:10:40 CST
Local: Tues 3 Nov 2009 23:10
Subject: Re: Semantics of some std::atomic<iType> member functions

Scott Meyers <use...@aristeia.com> writes:
> 29.5.1 in N2960 declares the following member functions for
> std::atomic_itype:

> integral operator+=(integral) volatile;
> integral operator-=(integral) volatile;
> integral operator&=(integral) volatile;
> integral operator|=(integral) volatile;
> integral operator^=(integral) volatile;

> Some of these are also declared for std::atomic_address and std::atomic<T*>.
> But I can't find any description of their semantics including, rather
> critically, whether they are atomic operations.  Am I overlooking semantic
> descriptions somewhere?

See 29.6p6.

C A::operator op=(M operand) volatile;
E ?ects: fetch_key(operand)
Returns: fetch_key(operand) op operand

where "key" and "op" are given in table 137. This says that a+=b
is equivalent to a.fetch_add(b)+b, and so forth for the other operators.

Anthony
--
Author of C++ Concurrency in Action | http://www.manning.com/williams
just::thread C++0x thread library   | http://www.stdthread.co.uk
Just Software Solutions Ltd         | http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-...@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Meyers  
View profile   Translate to Translated (View Original)
 More options 6 Nov, 20:43
Newsgroups: comp.std.c++
From: Scott Meyers <use...@aristeia.com>
Date: Fri, 6 Nov 2009 14:43:39 CST
Local: Fri 6 Nov 2009 20:43
Subject: Re: Semantics of some std::atomic<iType> member functions

Anthony Williams wrote:

> See 29.6p6.

> C A::operator op=(M operand) volatile;
> Effects: fetch_key(operand)
> Returns: fetch_key(operand) op operand

> where "key" and "op" are given in table 137. This says that a+=b
> is equivalent to a.fetch_add(b)+b, and so forth for the other operators.

Okay, I see it now.  Silly me, searching for "|=" in an attempt to
find a description of semantics for operator|=.

For the record, my copy of N2960 has this information in paragraphs
22ff, not paragraph 6.

Scott

--
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-...@netlab.cs.rpi.edu]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anthony Williams  
View profile   Translate to Translated (View Original)
 More options 8 Nov, 00:05
Newsgroups: comp.std.c++
From: Anthony Williams <anthony....@gmail.com>
Date: Sat, 7 Nov 2009 18:05:27 CST
Local: Sun 8 Nov 2009 00:05
Subject: Re: Semantics of some std::atomic<iType> member functions

Scott Meyers <use...@aristeia.com> writes:
> Anthony Williams wrote:

>> See 29.6p6.

>> C A::operator op=(M operand) volatile;
>> Effects: fetch_key(operand)
>> Returns: fetch_key(operand) op operand

>> where "key" and "op" are given in table 137. This says that a+=b
>> is equivalent to a.fetch_add(b)+b, and so forth for the other operators.

> Okay, I see it now.  Silly me, searching for "|=" in an attempt to
> find a description of semantics for operator|=.

:-)

> For the record, my copy of N2960 has this information in paragraphs
> 22ff, not paragraph 6.

Oops, that was a typo. I meant paragraph 26 (which is what I quoted
above), but yes everything from 22 onwards is relevant.

Anthony
--
Author of C++ Concurrency in Action | http://www.manning.com/williams
just::thread C++0x thread library   | http://www.stdthread.co.uk
Just Software Solutions Ltd         | http://www.justsoftwaresolutions.co.uk
15 Carrallack Mews, St Just, Cornwall, TR19 7UL, UK. Company No. 5478976

[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use
mailto:std-...@netlab.cs.rpi.edu<std-c%2B...@netlab.cs.rpi.edu>
]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.comeaucomputing.com/csc/faq.html                      ]


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google