November 2009 C++ Standards Committee Mailing
Tuesday, 17 November 2009
The November 2009 mailing for the C++ Standards Committee was published last week. This is the post-meeting mailing for the October committee meeting and contains a new working draft incorporating all the proposals accepted at the October meeting.
As those of you who
read Herb
Sutter's blog
or Michael
Wong's blog will already know, the big news for concurrency is
that a proposal for std::async
has been
accepted, and this is reflected in the latest working
draft.
There are 5 concurrency-related papers (of which my name is on one), which I summarize below:
Concurrency-related papers
- N2985: C and C++ Thread Compatibility
Lawrence Crowl has been through the concurrency and multithreading support from the C++ working draft, and compared this to that now being added to the C working draft for the next C standard. This paper contains his observations and recommendations about the potential for compatibility between the types and functions provided by the two draft standards. I agree with some of his recommendations, and disagree with others. No action will be taken by the C++ committee unless his recommendations become full proposals.
- N2992: More Collected Issues with Atomics
This is Lawrence Crowl's paper which rounds up various issues with the C++ atomics. It was accepted by the committee, and has been incorporated into the working draft. The most noticeable change is that the atomic types and functions now live in the
<atomic>
header. The macro for identifying lock-free atomics has been expanded into a set of macros, one per type, and a guarantee has been added that all instances of a type are lock-free, or all are not lock-free (rather than it being allowed to vary between objects). There is also a clarification that if you use compare-exchange operations on a type with padding bits then the padding bits will be part of the comparison (which will therefore affectatomic<float>
or similar), plus a few other clarifications.- N2996: A Simple Asynchronous Call
This paper is by Herb Sutter and Lawrence Crowl, and brings together their papers from the pre-meeting mailing (N2970 and N2973) based on feedback from the committee. This is the
std::async
proposal that got accepted, and which has been incorporated into the working draft.The result is that we have a variadic
async
function with an optional launch policy as the first argument, which specifies whether the function is to be spawned on a separate thread, deferred untilget()
orwait()
is called on the returnedfuture
, or either, at the choice of the implementation.- N2997: Issues on Futures (Rev. 1)
This is a revision of N2967 from the pre-meeting mailing, which incorporates feedback from the committee. This is the version that was accepted, and which has been incorporated into the working draft. The key change is that
unique_future
has been renamed to justfuture
in order to make things easier to read in what is anticipated to be the common case.- N2999: Background for issue 887: Clocks and Condition Variables (Rev. 1)
This is a minor revision of Detlef's paper from the pre-meeting mailing (N2969). The changes it proposes have not yet been accepted into the working paper, and will make it implementation-dependent which clocks can be used for condition variable waits.
Other concurrency changes in the working draft
std::mutex
now has aconstexpr
constructor, so namespace-scope objects are guaranteed to be safe from initialization order issues.- The return type of the
wait_for
andwait_until
member functions ofstd::condition_variable
andstd::condition_variable_any
has been changed from abool
to acv_status
enum. This makes it clear whether the return is due to a signal (or spurious wake) or because the operation timed out.
Updated implementation
Our just::thread
implementation of the C++0x thread library will shortly be updated
to incorporate all these changes (including an implementation
of std::async
). Existing customers will get a free
upgrade as usual.
Posted by Anthony Williams
[/ cplusplus /] permanent link
Tags: C++0x, C++, standards, concurrency
Stumble It! | Submit to Reddit | Submit to DZone
If you liked this post, why not subscribe to the RSS feed or Follow me on Twitter? You can also subscribe to this blog by email using the form on the left.
Design and Content Copyright © 2005-2024 Just Software Solutions Ltd. All rights reserved. | Privacy Policy
4 Comments
There isn't an active defect report on 1.10 regarding lock vs mutex. I'll submit one on your behalf.