Comment policy
[Updated 3/17 for clarity.]
On this blog, I’ve always been happy to follow a policy of not editing or filtering comments, and to let comments stand whether the commenter agrees with me or not. However, recently a few comments have strayed into name-calling (e.g., I’d never heard the term “freetard” until last week), and I’ve decided to start moderating all comments, and to remove some existing comments that seem to me to be disrespectful of others.
Fortunately, the vast majority of comments aren’t like that, and opinions that respectfully disagree with my own or with those of other commenters continue to be welcome. Thanks for understanding.
Trip Report: March 2010 ISO C++ Standards Meeting
[Note: I usually post trip reports after the public post-meeting mailing goes live a few weeks after the meeting, so that I can provide links to minutes and papers. This time, I wanted to post the report right away to share the news. If you’re interested in the post-meeting papers, including the official minutes, watch the 2010 papers page which is where they will appear in a few weeks.]
The ISO C++ committee met in Pittsburgh, PA, USA on March 8-13, 2010, hosted by the CERT Software Engineering Institute at Carnegie Mellon University. As usual, about 50 experts attended, and we had eight official national body delegations from Canada, Finland, France, Netherlands, Spain, Switzerland, United Kingdom, and United States.
The meeting just concluded a few minutes ago (yes, the meetings run through Saturday afternoon). Here are some highlights of what happened today, which was another landmark in the progression of the C++0x standard.
Approved Final Committee Draft (FCD) for C++0x
The biggest news is that this afternoon we voted in the final remaining feature changes to C++0x, and to much applause then unanimously approved the text for international ballot as a Final Committee Draft (FCD). FCD means that, assuming no surprises, we intend to do only bug fixes and editorial corrections for the next year or so, and then ballot a final standard. If we can do that, assuming all goes well, C++0x could officially be published as soon as next year as ISO C++ 2011, and we can stop with the “x-is-hex” jokes and just start calling it C++11.
This is a big milestone, and it was achieved thanks to removing a couple of controversial features last summer and a whole lot of work by the ISO C++ committee members over the past six months in particular. That work includes countless hours spent between our full face-to-face meetings at face-to-face ad-hoc meetings to swat library bugs, teleconferences on resolving core language questions, and triple-digit person-hours invested in four teleconferences during December-February purely about C and C++ compatibility that have greatly helped to identify and attempt to resolve minor areas of divergence between the C++0x draft standard and the C1x draft standard (as both are now in progress; C1x is targeting completion and publication in 2012).
All in all, your committee members have put in an enormous amount of effort to bring this in, and the draft is in far better shape for this meeting than anyone could have expected last summer. For comparison, in my and several others’ opinions, it’s in better shape than the FCD of the C++98 standard.
Since we’re closing down this round of standardization, we didn’t make many exciting technical changes. Here are two technical highlights of the meeting that are likely of general interest, finally adopting changes we’ve contemplated before.
Removed Export Template
As I reported after the last meeting (here and here), the committee considered the question of whether to deprecate, remove, or leave in the “export template” feature.
For context, the only reason we’re even considering this is because Edison Design Group (EDG), the only company to ever implement export, is recommending export be removed or deprecated. Recall that back in the 1990s the committee originally voted the feature in over EDG’s objections in the first place, then in the late 1990s and early 2000s EDG graciously and gallantly went on to invest enormous effort to implement the feature in order to conform to the standard, and so the committee was loath to punish them again by now removing the feature on them. However, given the passage of time, EDG reports that their experience in the field has been that nearly no one actually uses the feature, and that it would be right (and okay with EDG) to deprecate or remove it.
At our previous meeting, the general sentiment was in favor of deprecation only. However, at this meeting EDG reported that they would prefer the feature to be removed rather than just deprecated, because a deprecated feature is still part of the standard and required for conformance. By removing it from C++0x, it removes the maintenance burden of being forced to support export indefinitely to maintain full standards conformance (though of course EDG will continue to support it as an extension in their compiler front end for however long seems right based on their own customers’ demand).
The committee agreed, and today voted to remove export entirely from C++0x. The “export” keyword is still reserved for future use, but has no defined meaning in the C++0x standard.
Deprecated Exception Specifications, Added noexcept
As also considered at our previous meeting, this week we went ahead and deprecated throw-specifications (e.g., throw(), throw( Base, Derived1 )). For rationale, see the two background references referred to in the proposal, one of which is an article by me:
- H. Sutter. “A Pragmatic Look at Exception Specifications”
- Boost. “Boost Exception Specification Rationale”
As noted in the second reference, “A non-inline function is the one place a ‘throws nothing’ [i.e., throw()] exception-specification may have some benefit with some compilers.” Because this would have some utility, there is a replacement for empty exception-specifications… the noexcept keyword, which has the basic use syntax “void f() noexcept {…}”. It optionally takes a compile-time constant true/false expression that if true means the noexcept is in force, which helps libraries to write efficient overloads. This feature will be written about for years to come, but that’s the basic idea.
Here’s the concise summary from the core working group report by Steve Adamczyk (of EDG fame and longtime core working group chair):
We discussed two things related to exception specifications: noexcept (N3050), and deprecating exception specifications (N3051). There was some spirited discussion of what happens when you violate a promise not to throw. In the end, we decided that in such a circumstance terminate() gets called, and it’s unspecified whether any cleanup is done for local variables between the throw point and the point of the violated noexcept. It’s believed that for efficient implementations of exception handling a noexcept will not add any overhead and will not restrict optimization opportunities.
The old-style exception specifications, including the throw() form, will now be deprecated. The library specification needs to be updated to use noexcept instead, and that won’t happen at this meeting.
Note that the decision to call terminate() is not final and alternatives will be considered at future meetings. There was general (but not universal) agreement that the program should not be allowed to continue executing if a noexcept is violated because in that case the program will almost certainly be in a corrupt state, and so the consensus was in favor of guaranteeing to call terminate() instead of allowing arbitrary undefined behavior, but it’s possible that a comfortable middle ground between those two options may yet be found.
Looking Forward
We wrapped up with a presentation of the scheduled dates and locations for the next few ISO C++ standards committee meetings (meeting information link included where available):
- August 2-7, 2010: Rapperswil, Switzerland
- November 8-13, 2010: Batavia, Illinois, USA
- March 21-26, 2011: Madrid, Spain
Finally, here’s a copy of summary slide I presented, which will also be in the post-meeting mailing. Here’s to C++11 (we hope)!

Links I enjoyed reading this week
Concurrency-related (more or less directly)
Samples updated for ConcRT, PPL and Agents (Microsoft Parallel Programming blog)
Update to the samples for the Visual Studio 2010 Release Candidate. Hmm, I suppose I should include a link to that too:
- Visual Studio 2010 and .NET Framework 4 Release Candidate (Microsoft)
Freely downloadable, includes C++0x features like auto and lambdas and rvalue references (move semantics), nifty parallel programming libraries, and more.
Intel’s Core i7-980X Extreme processor (The Tech Report)
Desktop part with 12 hardware threads (6 cores x 2 threads/core), 32nm process, >1.1B transistors.
General information/amusement
Application compatibility layers are there for the customer, not for the program (Raymond Chen)
You wouldn’t believe the backward-compatibility hoops we all need to jump through hold in the right place for older apps to jump through, and then the app developer asks for more…
Jetpack to be commercially available soon? (Gizmag)
Yes, we see a story like this every few years. This one actually gets the flight time beyond just one minute. Now if we could only take the expected price down by one order of magnitude, and safety up by an order of magnitude or three…
Where can you get the ISO C++ standard, and what does “open standard” mean?
In my role as convener of the ISO C++ committee, I get to field a number of questions about the committee and its process. It occurred to me that some of them might be of more general interest, so I’ll occasionally publish an edited version of my reply here in case other people have similar questions. Note that the quoted questions may be paraphrased.
Today’s question comes from someone who recently asked about why, if ISO C++ is an open standard, ISO charges for it and we can’t just download it for free.
The short answer is that people sometimes confuse “open” with “free.” ISO standards aren’t “open” like the O in FOSS, they’re “open” like “not developed behind closed doors.” Anyone who wants to pay for membership in their national body (if their country participates in ISO and in the specific project in question) is able to come join the fun. In free-as-in-beer terms, this means that experts are welcome to come to the ISO brewery at their own expense and volunteer their time to help brew the beer, and then when the beer is ready the customers still pay ISO to drink it (the helpers don’t get a cut of that, only a free bottle for their personal use and the satisfaction of having brewed a mighty fine keg).
Longer answer follows:
ISO C++ claims to be an OPEN STANDARD. Where can I download the OPEN STANDARD for ISO C++.
All published ISO standards are available for sale from the ISO store, via http://iso.org. You can purchase a copy of the latest currently published C++ standard, 14882:2003, here for CHF 380:
Also, your national standards body may sell a copy. For example, the ANSI store sells a PDF version here for US$ 30:
However, before you buy one of those, note that we’ve been actively working on a new revision to that standard, and hope to be done in the next year or so. You can get a free copy of the latest (but incomplete) draft of the C++ standard here:
Note that this is a working draft as of a couple of weeks ago; it is not the standard currently in force, and it is not exactly the standard that will be published in the next year or two, but it is a draft of the latter that’s in pretty good shape but will still get some editorial corrections and technical tweaks.
By the way, what does it mean, that the STANDARD of a widely used language is OPEN? Especially if I have to pay for it?
All ISO standards are "open standards" in that they’re developed in an open, inclusive process. All member nations of ISO are eligible to participate, send experts, contribute material, vote on ballots, and so forth. Additionally, some working groups, including C and C++, make all of their papers and all working drafts freely available on the web, as with the link above; the only thing a working group is not allowed to make freely available, except with special permission from ISO, is the text of the final standard it produces, because ISO reserves the right to charge for that.
Could you explain to me, what should it mean if the STANDARD of a widely used language was CLOSED?
Generally, that means it was developed privately by some closed industry group or consortium that not everyone is allowed to join and participate in. Some standards are developed behind closed doors controlled by some company or companies. ISO standards are not like that.
Best wishes,
Herb
Effective Concurrency Europe 2010
Last May, I gave a public Effective Concurrency course in Stockholm. It was well-attended, and a number of people have asked if it will be offered again. The answer is yes.
I’m happy to report that Effective Concurrency Europe 2010 will be held on May 5-7, 2010, in Stockholm, Sweden. There’s an early-bird rate available for those who register before March 15.
I’ll cover the following topics:
- Fundamentals: Define basic concurrency goals and requirements • Understand applications’ scalability needs • Key concurrency patterns
- Isolation — Keep work separate: Running tasks in isolation and communicate via async messages • Integrating multiple messaging systems, including GUIs and sockets • Building responsive applications using background workers • Threads vs. thread pools
- Scalability — Re-enable the Free Lunch: When and how to use more cores • Exploiting parallelism in algorithms • Exploiting parallelism in data structures • Breaking the scalability barrier
- Consistency — Don’t Corrupt Shared State: The many pitfalls of locks–deadlock, convoys, etc. • Locking best practices • Reducing the need for locking shared data • Safe lock-free coding patterns • Avoiding the pitfalls of general lock-free coding • Races and race-related effects
- High Performance Concurrency: Machine architecture and concurrency • Costs of fundamental operations, including locks, context switches, and system calls • Memory and cache effects • Data structures that support and undermine concurrency • Enabling linear and superlinear scaling
- Migrating Existing Code Bases to Use Concurrency
- Near-Future Tools and Features
I hope to see some of you there!
Machine Architecture slides back online
A number of people reported that the PDF slides for my Machine Architecture talk were offline. It turns out that the NWCPP servers were recently moved and the link temporarily broken, but it’s now been restored.
Links:
- Google video
- PDF slides (back again)
Igor Ostrovsky and the Seven Cache Effects
My colleague Igor Ostrovsky has written a useful summary of seven cache memory effects that every advanced developer should know about because of their performance impact, particularly as we strive to keep invisible bottlenecks out of parallel code.
I’ve covered variations of Igor’s examples #1, #2, #3, and #6 in my Machine Architecture talk and several of my articles. His article provides a crisp and concise summary of these and three more kinds of cache effects along with simple and clear sample code and intriguing measurements (for example, see the detail in the graph for #5 and its analysis).
Recommended.
Effective Concurrency: Prefer Futures to Baked-In “Async APIs”
This month’s Effective Concurrency column, Prefer Futures to Baked-In “Async APIs”, is now live on DDJ’s website.
From the article:
When designing concurrent APIs, separate "what" from "how"
Let’s say you have an existing synchronous API function [called DoSomething]… Because DoSomething could take a long time to execute (whether it keeps a CPU core busy or not), and might be independent of other work the caller is doing, naturally the caller might want to execute DoSomething asynchronously. …
The question is, how should we enable that? There is a simple and correct answer, but because many interfaces have opted for a more complex answer let’s consider that one first.
I hope you enjoy it. Finally, here are links to previous Effective Concurrency columns:
The Pillars of Concurrency (Aug 2007)
How Much Scalability Do You Have or Need? (Sep 2007)
Use Critical Sections (Preferably Locks) to Eliminate Races (Oct 2007)
Apply Critical Sections Consistently (Nov 2007)
Avoid Calling Unknown Code While Inside a Critical Section (Dec 2007)
Use Lock Hierarchies to Avoid Deadlock (Jan 2008)
Break Amdahl’s Law! (Feb 2008)
Going Superlinear (Mar 2008)
Super Linearity and the Bigger Machine (Apr 2008)
Interrupt Politely (May 2008)
Maximize Locality, Minimize Contention (Jun 2008)
Choose Concurrency-Friendly Data Structures (Jul 2008)
The Many Faces of Deadlock (Aug 2008)
Lock-Free Code: A False Sense of Security (Sep 2008)
Writing Lock-Free Code: A Corrected Queue (Oct 2008)
Writing a Generalized Concurrent Queue (Nov 2008)
Understanding Parallel Performance (Dec 2008)
Measuring Parallel Performance: Optimizing a Concurrent Queue (Jan 2009)
volatile vs. volatile (Feb 2009)
Sharing Is the Root of All Contention (Mar 2009)
Use Threads Correctly = Isolation + Asynchronous Messages (Apr 2009)
Use Thread Pools Correctly: Keep Tasks Short and Nonblocking (Apr 2009)
Eliminate False Sharing (May 2009)
Break Up and Interleave Work to Keep Threads Responsive (Jun 2009)
The Power of “In Progress” (Jul 2009)
Design for Manycore Systems (Aug 2009)
Avoid Exposing Concurrency – Hide It Inside Synchronous Methods (Oct 2009)
Prefer structured lifetimes – local, nested, bounded, deterministic (Nov 2009)
Prefer Futures to Baked-In “Async APIs” (Jan 2010)
C++ and Beyond: Summer 2010, Vote the Date
I always enjoy teaching together with Scott Meyers and Andrei Alexandrescu, not only because it means I get to work with good friends, but also because I get to listen to them speak. Scott and Andrei always have interesting and useful things to say and say them well. We occasionally speak at the same big conferences, but at those we’re often scheduled at the same time and so we don’t get to hear each other’s sessions (and attendees likewise have to choose one competing session or the other for that time slot), and presenting in large rooms to hundreds of people makes it hard to get much quality face time with the individual audience members.
So I’m really looking forward to spending three days together with Scott and Andrei and a limited number of attendees at a new event called C++ and Beyond:
What do C++ programmers think about these days? Perhaps the new features from C++0x that are becoming commonly available and that introduce fundamental changes in how C++ software is designed. Perhaps the increasing importance of developing effective concurrent systems. Perhaps the continuing pressure to create high-performance software. Possibly the impact of new systems programming languages such as D. Most likely, all of the above, and more.
C++ legends Scott Meyers, Herb Sutter, and Andrei Alexandrescu think about these things, too — all the time. Scott and Herb are neck-deep in C++0x, while Andrei is literally writing the book on D (The D Programming Language). Herb and Andrei put the pedal to the metal on applied concurrency and parallelism; Herb is writing the book on that topic (Effective Concurrency). All three focus on the development of high-performance systems, a topic Scott’s writing a book about (Fastware!).
This summer, Scott, Herb, and Andrei will host an intensive three-day technical event focusing on “C++ and Beyond” — an examination of issues related to C++ and its application in high-performance (typically highly concurrent) systems, as well as related technologies of likely interest to C++ programmers.
We know it’ll be in the Seattle area. We know it’ll be this summer. What we don’t know is which of the two candidate dates (in June or August) works best for you, so we thought we’d let you decide: If you’re potentially interested in attending, please vote for your preferred date. At that page you can also let us know what kinds of topics you’d like to see covered.
Once we finalize the details we’ll post them and open registration. You can subscribe to follow announcements via this feed.
We hope to see you in the beautiful Pacific Northwest this summer.