Just Software Solutions

ACCU 2013 and the C++ Standards Meeting

Monday, 06 May 2013

This year's ACCU conference was at a new venue: the Marriott hotel in Bristol. This is a bit closer to home for me than the previous venue in Oxford, which made the trip there and back more comfortable. As ever, the conference itself was enjoyable, educational and exhausting in equal measure.

This year was also BSI's turn to host the Spring ISO C++ committee meeting, which was conveniently arranged to be the week following ACCU, in the same hotel. Having not attended a meeting since the last time the committee met in the UK, I was glad to be able to attend this too.

ACCU 2013

As usual, with 5 tracks running simultaneously, it was hard to choose which sessions to attend. I stuck mostly to C++-centric, or general software development sessions, but there were also sessions on a wide range of other topics, including Ruby, Java, Scala, Git, C#, testing, management and culture, amongst others.

I was invited to contribute to Pete Goodliffe's Becoming a Better Programmer panel session, which was well attended and entertaining, as usual for Pete's sessions. My contribution on "doing things mindfully" seemed well-received, but wasn't the most popular — that honour went to Seb Rose, though Brian Marick called out Anna-Jayne Metcalfe's contribution on "If it ain't broke, do fix it" in the keynote the next morning.

My presentation on "C++11 in the Real World" was also well attended, with some good questions from the audience. A couple of people have asked me for my slides: they are available from the ACCU website.

ISO C++ committee meeting

This was a landmark meeting, for several reasons. Firstly, there were over 100 attendees, making it one of the most well-attended ISO C++ meetings ever. Secondly, this bumper attendee count was complemented by a bumper batch of proposals and position papers to process, which meant that all the working groups were pressed for time, and people met for extra sessions in the evenings to try and get through them all. Finally, the committee voted to publish a new "CD", starting the formal process leading to a C++14 standard.

The meeting was 6 days long, but I was only able to attend for the first 2 days. Unsurprisingly, I spent my time in the Concurrency group (SG1). We had a lot of papers to discuss, and some of the discussions were quite involved. Ultimately, not many papers were forwarded to the full committee, and only one paper other than the basic defect-report fixes was approved.

Lawrence Crowl's paper on Stream Mutexes (N3535) was first up. The problem this paper is trying to address is ensuring that data written to a stream from multiple threads appears in a coherent order — though concurrent writes to e.g. std::cout are guaranteed not to yield undefined behaviour, the output may be interleaved in an arbitrary fashion. This got quite a bit of discussion over the course of the week, and was eventually submitted as a much-modified paper for writing chunks to a stream in an atomic fashion, which was voted down in full committee.

Herb Sutter's late paper on the behaviour of the destructor of std::future (N3630) was up next. This is a highly conterversial topic, and yielded much discussion. The crux of the matter is that as currently specified the destructor of std::future blocks if it came from an invocation of std::async, the asynchronous function was run on a separate thread (with the std::launch::async policy), and that thread has not yet finished. This is highly desirable in many circumstances, but Herb argued that there are other circumstances where it is less desirable, and this makes it hard to use std::future in some types of program.

Much of the discussion focused on the potential for breaking existing code, and ways of preventing this. The proposal eventually morphed into a new paper (N3637) which created 2 new types of future: waiting_future and shared_waiting_future. std::async would then be changed to return a waiting_future instead of a future. Existing code that compiled unchanged would then keep the existing behaviour; code that changed behaviour would fail to compile. Though the change required to get the desired behaviour would not be extensive, the feeling in the full committee was that this breakage would be too extensive, and the paper was also voted down in full committee.

Herb's original paper also included a change to the destructor of std::thread, so that the destructor of a joinable thread would call join() rather than std::terminate(). This was put up for vote as N3636, but again was voted down in full committee.

Like I said, there were lots of other papers up for discussion. Some were concrete proposals, whilst others were less complete, asking for feedback on the approach. Only one paper was approved for the C++14 time frame — whilst there was considerable interest in the idea behind some of the others, there was disagreement about the details, and nothing else was deemed ready. I look forward to seeing the revised versions of some of these proposals when they are ready, especially the executors, continuations and parallel algorithms papers.

The paper that did get approved was Howard Hinnant's paper on shared locking (N3568), but even that didn't go through unchanged. I have serious concerns about the upgrade_mutex proposed in the original paper, and while I didn't manage to get my concerns across via email (this was discussed after I left), there was not enough interest in including it in C++14. The approved paper (N3659) therefore included only shared_mutex and shared_lock, not upgrade_mutex, which is good. N3659 was also approved by the vote in full committee, so will be part of C++14.

Wrap up

Having the conference and ISO meeting back-to-back was intense, but I thoroughly enjoyed attending both. C++14 looks set to be a significant improvement over C++11 — though the individual changes are minor, they offer quite a bit in terms of improved usability of the language and library. See the trip reports by Herb Sutter and Michael Wong (part 2, part 3) for more details on the accepted papers.

Posted by Anthony Williams
[/ news /] permanent link
Tags: , , ,
Stumble It! stumbleupon logo | Submit to Reddit reddit logo | Submit to DZone dzone logo

Comment on this post

If you liked this post, why not subscribe to the RSS feed RSS feed or Follow me on Twitter? You can also subscribe to this blog by email using the form on the left.


Useful information shared..Iam very happy to read this article..thanks for giving us nice info.Fantastic walk-through. I appreciate this post.
by tafelblad at 15:00:33 on Monday, 21 January 2019
by super smash flash 2 at 15:00:33 on Monday, 21 January 2019

This is such a great resource that you are providing and you give it away for free. I love seeing that understand the value of providing a quality resource for free

by bloons tower defense 5 at 15:00:33 on Monday, 21 January 2019
This blog entry was written in a way that wasn't the best for it but the information that was given made up for that.
by keukenwerkblad at 15:00:33 on Monday, 21 January 2019

do you know play this games wings.io

by wings.io at 15:00:33 on Monday, 21 January 2019

let's play this gmaes slither.io in here .it is very hot in the world

by slither.io at 15:00:33 on Monday, 21 January 2019

if you like click to play this games for kids

by games for kids at 15:00:33 on Monday, 21 January 2019

if you want you can win play this games happy wheels in here

by happy wheels the game at 15:00:33 on Monday, 21 January 2019

I am impressed by the information that you have on this blog. It shows how well you understand this subject

by happy wheels at 15:00:33 on Monday, 21 January 2019
by a10 games at 15:00:33 on Monday, 21 January 2019

I really like the dear information you offer in your articles.

by color switch at 15:00:33 on Monday, 21 January 2019
by roblox at 15:00:33 on Monday, 21 January 2019

Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone

by mortal kombat x at 15:00:33 on Monday, 21 January 2019

play the best free games slither io

by slither io at 15:00:33 on Monday, 21 January 2019

if you like click to play wingsio

by wingsio at 15:00:33 on Monday, 21 January 2019

click to play abc

by abc at 15:00:33 on Monday, 21 January 2019
I'm getting excited about this kind of beneficial information of your stuff in the future
by ColdFusion Project Help at 15:00:33 on Monday, 21 January 2019
Thank you very much! Your blog is always full of great idea. They are really helpful
by list of emoticons at 15:00:33 on Monday, 21 January 2019

Nice trip report! I like how you, very shortly and to the point, walk through the papers one by one. When the committee votes down a proposal like N3535, is their motivation for that available for read somewhere?

by TommyS at 15:00:33 on Monday, 21 January 2019


Could you explain why you think upgradable mutex is not a good idea in the end? I'm using two instances of boost ones in my current (game) application which uses TBB and boost for multithreading. I have no idea what might be the problem with upgradable mutex, so could you clarify so that I can decide if I should keep the related code?

by Joel Lamotte at 15:00:33 on Monday, 21 January 2019

@Tommy: The rationale is not currently publicly available. It might be in the minutes when they are published, but I can't remember how detailed the public ones get. I know there was concern about complexity and implementation overhead, but I was not present for the full discussion.

@Joel: I think that most of the time a need for an upgradeable mutex is a sign that the design could be improved. The implementation overhead of an upgradeable mutex is quite large, more so even than a simple shared mutex, so you may well be better off performance-wise with just a plain mutex. Certainly, it is worth profiling.

The other issue is that the design Howard posted (and the design of the boost equivalent) is fragile --- it is easy to write incorrect code, and especially easy to write code which is only incorrect on infrequently-used paths, such as error cases and when an exception is thrown.

by Anthony Williams at 15:00:33 on Monday, 21 January 2019

Thanks for this report Anthony. Could you share any additional details on the motivation for voting down N3636? I've recently been thinking about this very issue and haven't been able to come up with a use case for a (non-detached) std::thread object which is *not* wrapped in an RAII class designed to call join. Calling std::terminate is rarely the desired behaviour for any code so why is it preferred over join in this case? Thanks.

by Andrew Durward at 15:00:33 on Monday, 21 January 2019

This is nice information because i was also searching this type of help and techniques in my work. thanks again.

by Dipti Kapoor at 15:00:33 on Monday, 21 January 2019

nice post

by Sarah Nelson at 15:00:33 on Monday, 21 January 2019
by Olivia Jennifer at 15:00:33 on Monday, 21 January 2019
by Keukenblad at 15:00:33 on Monday, 21 January 2019
Hi, I think now I have a strong hold over the topic after going through the post. The subject that you have discussed in the post is really amazing; I will surely come back for more information. <a href="www.composietwerkblad.be">Werkblad</a>
by werkblad at 15:00:33 on Monday, 21 January 2019

Awesome work you have done here, I am very happy to read this nice post. You are a great writer and give us much information.Thanks for sharing with us.I wanna visited again.

by Justhost Coupon at 15:00:33 on Monday, 21 January 2019
Thank you for this informative post that you have in here. Actually, it is very helpful information to those investors.
by werkblad graniet at 15:00:33 on Monday, 21 January 2019
by website laten maken at 15:00:33 on Monday, 21 January 2019

Add your comment

Your name:

Email address:

Your comment:

Design and Content Copyright © 2005-2024 Just Software Solutions Ltd. All rights reserved. | Privacy Policy