<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">

  <title>C++</title>
  <link rel="self" href="http://chris.iluo.net/rss/chris/cplusplus.xml"/>
  <updated>2008-12-01T10:19:36-08:00</updated>
  <author>
    <name>Chris</name>
    <email>AUTHOR_EMAIL@email.com</email>
    <uri>http://chris.iluo.net/rss/chris/cplusplus</uri>
  </author>
  <id>urn:tag:chris.iluo.net,CHANNEL1</id>

  <entry>
    <title>(out of order) Effective Concurrency: Wr</title>
    <link href="http://herbsutter.wordpress.com/2008/11/02/out-of-order-effective-concurrency-writing-lock-free-code-a-corrected-queue/"/>
    <id>http://yoursite/article/?i=7a3ef347955a13237c805f8e29175d4d</id>
    <updated>2008-11-02T11:00:06-08:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Oops, I just noticed that I forgot to blog about one recent Effective Concurrency column: &#8220;Writing Lock-Free Code: A Corrected Queue&#8221; which also appeared in the October 2008 print issue of Dr. Dobb&#8217;s Journal.
From the article:

As we saw last month [1], lock-free coding is hard even for experts. There, I dissected a published lock-free queue implementation [2] and examined why the code was quite broken. This month, let&#8217;s see how to do it right.
Here is the complete-as-of-this-writing set of links to the published Effective Concurrency columns. As always, the months reflect the magazine print issue dates; they usually hit the web a bit sooner:
August 2007: The Pillars of Concurrency
September 2007: How Much Scalability Do You Have or Need?
October 2007: Use Critical Sections (Preferably Locks) to Eliminate Races
November 2007: Apply Critical Sections Consistently
December 2007: Avoid Calling Unknown Code While Inside a Critical Section
January 2007: Use Lock Hierarchies to Avoid Deadlock
February 2008: Break Amdahl?s Law!
March 2008: Going Superlinear
April 2008: Super Linearity and the Bigger Machine
May 2008: Interrupt Politely
June 2008: Maximize Locality, Minimize Contention
July 2008: Choose Concurrency-Friendly Data Structures
August 2008: The Many Faces of Deadlock
September 2008: Lock-Free Code: A False Sense of Security
October 2008: Writing Lock-Free Code: A Corrected Queue
November 2008: Writing a Generalized Concurrent Queue
December 2008: Understanding Parallel Performance

Posted in Concurrency, Software Development           </div></summary>
  </entry>

  <entry>
    <title>Effective Concurrency: Understanding Par</title>
    <link href="http://herbsutter.wordpress.com/2008/11/02/effective-concurrency-understanding-parallel-performance/"/>
    <id>http://yoursite/article/?i=85dbfe6c7369afa04158e5fafa1a5df5</id>
    <updated>2008-11-02T11:00:06-08:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Wow, DDJ just posted the previous one a few days ago, and already the next Effective Concurrency column is available: &#8220;Understanding Parallel Performance&#8221; just went live, and will also appear in the print magazine.
From the article:
Let&#8217;s say that we&#8217;ve slickly written our code to apply divide-and-conquer algorithms and concurrent data structures and parallel traversals and all our other cool tricks that make our code wonderfully scalable in theory. Question: How do we know how well we&#8217;ve actually succeeded? Do we really know, or did we just try a couple of tests on a quad-core that looked reasonable and call it good? What key factors must we measure to understand our code&#8217;s performance, and answer not only whether our code scales, but quantify how well under different circumstances and workloads? What costs of concurrency do we have to take into account?
This month, I&#8217;ll summarize some key issues we need to keep in mind to accurately analyze the real performance of our parallel code. I&#8217;ll list some basic considerations, and then some common costs. Next month, I have a treat in store: We&#8217;ll take some real code and apply these techniques to analyze its performance in detail as we successively apply a number of optimizations and measure how much each one actually buys us, under what conditions and in what directions, and why.

I hope you enjoy it. Finally, here are links to previous Effective Concurrency columns (based on the magazine print issue dates):
August 2007: The Pillars of Concurrency
September 2007: How Much Scalability Do You Have or Need?
October 2007: Use Critical Sections (Preferably Locks) to Eliminate Races
November 2007: Apply Critical Sections Consistently
December 2007: Avoid Calling Unknown Code While Inside a Critical Section
January 2007: Use Lock Hierarchies to Avoid Deadlock
February 2008: Break Amdahl?s Law!
March 2008: Going Superlinear
April 2008: Super Linearity and the Bigger Machine
May 2008: Interrupt Politely
June 2008: Maximize Locality, Minimize Contention
July 2008: Choose Concurrency-Friendly Data Structures
August 2008: The Many Faces of Deadlock
September 2008: Lock-Free Code: A False Sense of Security
October 2008: Writing Lock-Free Code: A Corrected Queue
November 2008: Writing a Generalized Concurrent Queue
December 2008: Understanding Parallel Performance

Posted in Concurrency, Software Development           </div></summary>
  </entry>

  <entry>
    <title>Effective Concurrency: Writing a General</title>
    <link href="http://herbsutter.wordpress.com/2008/10/30/effective-concurrency-writing-a-generalized-concurrent-queue/"/>
    <id>http://yoursite/article/?i=6782dae2481532b90a3c61553cc168ad</id>
    <updated>2008-10-30T08:30:04-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">DDJ posted the next Effective Concurrency column a couple of weeks earlier than usual. You can find it here: ?Writing a Generalized Concurrent Queue?, just went live on DDJ?s site, and also appears in the print magazine.
From the article:

Last month [1], I showed code for a lock-free queue that supported the limited case of exactly two threads?one producer, and one consumer. That&#8217;s useful, but maybe not as exciting now that our first rush of lock-free coding glee has worn off. This month, let&#8217;s tackle the general problem of supporting multiple producers and multiple consumers with as much concurrency as possible. The code in this article uses four main design techniques: &#8230;

I hope you enjoy it. Finally, here are links to previous Effective Concurrency columns (based on the magazine print issue dates):

August 2007: The Pillars of Concurrency
September 2007: How Much Scalability Do You Have or Need?
October 2007: Use Critical Sections (Preferably Locks) to Eliminate Races
November 2007: Apply Critical Sections Consistently
December 2007: Avoid Calling Unknown Code While Inside a Critical Section
January 2007: Use Lock Hierarchies to Avoid Deadlock
February 2008: Break Amdahl?s Law!
March 2008: Going Superlinear
April 2008: Super Linearity and the Bigger Machine
May 2008: Interrupt Politely
June 2008: Maximize Locality, Minimize Contention
July 2008: Choose Concurrency-Friendly Data Structures
August 2008: The Many Faces of Deadlock
September 2008: ?Lock-Free Code: A False Sense of Security?
October 2008: ?Writing a Generalized Concurrent Queue?

Posted in Concurrency, Software Development           </div></summary>
  </entry>

  <entry>
    <title>September 2008 ISO C++ Standards Meeting</title>
    <link href="http://herbsutter.wordpress.com/2008/10/28/september-2008-iso-c-standards-meeting-the-draft-has-landed-and-a-new-convener/"/>
    <id>http://yoursite/article/?i=b835fdf9828d6e8ce57f9bbe7bdded2d</id>
    <updated>2008-10-28T19:30:05-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The ISO C++ committee met in San Francisco, CA, on September 15-20. You can find the minutes here, including the votes to approve papers.
The most important thing the committee accomplished was this:
Complete C++0x draft published for international ballot
The biggest goal entering this meeting was to make C++0x feature-complete and stay on track to publish a complete public draft of C++0x for international review and comment ? in ISO-speak, an official Committee Draft or CD. As I predicted in the summer, the committee achieved that at this meeting. Now the world will know the shape of C++0x in good detail. Here&#8217;s where to find it: The September C++0x working draft document is essentially the same as the September 2008 CD.
This is ?it?, feature-complete C++0x, including the major feature of &#8220;concepts&#8221; which had its own extensive set of papers for language and library extensions &#8212; I&#8217;ll stop there, but there are still more concepts papers at the mailing page and some more still to come during the CD phase. (If you get the impression that concepts is a big feature, well, it is indeed easily the biggest addition we made in C++0x.)
What&#8217;s next? As I&#8217;ve mentioned before, we?re planning to have two rounds of international comment review. The first of two opportunities for national bodies to give their comments is now underway; the second round will probably be this time next year. The only changes expected to be made between that CD and the final International Standard are bug fixes and clarifications. It?s helpful to think of a CD as a feature-complete beta, and we&#8217;re on track to ship one more beta before the full release.
And a new convener
On a personal note, I&#8217;m very happy to see this accomplished at the last meeting during my convenership. I&#8217;ve now served as secretary and then convener (chair) of the ISO C++ committee for over 10 years, and my second three-year term as convener ended one week after the San Francisco meeting. A decade is enough; I decided not to volunteer for another term as chair.
As of a few weeks ago, P. J. Plauger is the new convener of ISO/IEC JTC1/SC22/WG21 (C++). Many of you will know P.J. (or Bill, as he&#8217;s known within the committee) from his long service to the C and C++ communities, including that he has been a past convener of the ISO C standards committee, past editor of the C/C++ Users Journal, the principal author of the Dinkumware implementation of the C++ standard library, and recipient of the 2004 Dr Dobb&#8217;s Journal Excellence in Programming Award, among various other qualifications and honors. He has been a regular participant at ISO C++ meetings for about as long as they&#8217;ve been held, and his long experience with both the technology and the ISO standards world will serve WG21 well.
I&#8217;m very happy to have been able to chair the committee during the development of C++0x. Now as we move from &#8220;develop mode&#8221; into &#8220;ship mode&#8221; it will be great to have his experienced hand guiding the committee through the final ISO process. Thanks for volunteering, Bill!
Posted in C++           </div></summary>
  </entry>

  <entry>
    <title>Stroustrup  Sutter on C++ 2008, Second S</title>
    <link href="http://herbsutter.wordpress.com/2008/10/01/stroustrup-sutter-on-c-2008-second-showing-october-30-31-2008-in-boston-ma-usa/"/>
    <id>http://yoursite/article/?i=62827867e1d21f8038707557e1b057a6</id>
    <updated>2008-10-01T21:30:06-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"> This spring at SD West in Santa Clara, Bjarne and I did a fresh-and-updated S&amp;S event with lots of new material.
We don&#8217;t usually repeat the same material, but this time there&#8217;s been such demand that we agreed to do a repeat&#8230; four weeks from today, in Boston. More information and talk descriptions follow.
CONTENT ADVISORY
Again, usually our S&amp;S events feature mostly new material, but this one is almost identical to the material we did in spring 2008 in Santa Clara. Bjarne is substituting one talk, and will present &#8220;C++ in Safety-Critical Systems&#8221; instead of his talk on C++&#8217;s design and evolution; and we&#8217;ll both be updating to the material to reflect the current state of the draft ISO C++0x standard. But otherwise it&#8217;ll be identical.
So:

If you missed our event this spring, here&#8217;s your second chance! It was our highest-rated S&amp;S ever, and in the post-conference survey we asked the question &#8220;Would you recommend this course to a colleague?&#8221; and 100% said yes.
If you already attended this spring and came to all our sessions, you&#8217;ve seen nearly all this material already, but feel free to encourage a friend or colleague to attend who you think would benefit from the material.

The Talks
Wednesday, October 29, 2008 
C++0x Overview (Bjarne Stroustrup)
What Not to Code: Avoiding Bad Design Choices and Worse Implementations (Herb Sutter)
How to Design Good Interfaces (Bjarne Stroustrup)
How to Migrate C++ Code to the Manycore &#8220;Free Lunch&#8221; (Herb Sutter) 
Grill the Experts: Ask Us Anything! (Bjarne Stroustrup &amp; Herb Sutter)
Thursday, October 30, 2008
["Best of Stroustrup &amp; Sutter"] Update of talk voted ?Most Informative? at S&amp;S 2007: Concepts and Generic Programming in C++0x (Bjarne Stroustrup)
Safe Locking: Best Practices to Eliminate Race Conditions (Herb Sutter)
C++ in Safety-Critical Systems (Bjarne Stroustrup)
Lock-Free Programming in C++?or How to Juggle Razor Blades (Herb Sutter)
Discussion on Questions Raised During the Seminar (Herb Sutter &amp; Bjarne Stroustrup)

Registration
This two-day seminar is getting billing on two different conferences that are running at the same time in the Hynes Convention Center: SD Best Practices and the Embedded Systems Conference. S&amp;S is technically part of both conferences, which means you can attend S&amp;S via either one&#8230; either

register via SDBP, or
register via ESC 

and both ways will include options that include our two-day seminar.
I look forward to seeing many of you in Boston! Best wishes,
Herb
Posted in C++, Software Development, Talks &amp; Events           </div></summary>
  </entry>

  <entry>
    <title>Data and Perspective</title>
    <link href="http://herbsutter.wordpress.com/2008/09/30/data-and-perspective/"/>
    <id>http://yoursite/article/?i=615075873d10b3d13fab4f5717abd519</id>
    <updated>2008-09-30T12:00:17-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Even genuinely newsworthy topics can get distorted when commentators exaggerate or use data selectively. Here are two recent examples I noticed.
&#8220;This is the worst financial crisis since the Great Depression.&#8221; It&#8217;s true that it&#8217;s bad and even historic, and this sound bite correctly doesn&#8217;t actually claim it&#8217;s as bad as the Depression. I hope it doesn&#8217;t turn out to be in the same league as that; then, people were lining up at soup kitchens. For now, however, Apple is still on track to sell 10 million iPhone 3Gs this year, which says something.
&#8220;Yesterday [Monday, September 29, 2008] saw the worst single-day plunge in Dow Jones history.&#8221; &#8220;It&#8217;s a new Black Monday.&#8221; Well, these got my attention, because I remember Black Monday on October 19, 1987 very well. I was working in IT at a major bank, doing software application support for traders and related departments. When I went up to the trading floor that day, I immediately knew something was badly wrong because of the eerie sound as the elevator doors opened &#8212; a sound you never hear during trading hours, and certainly not from a room full of traders standing at their desks: silence.
Yesterday&#8217;s loss of 777 points was stunning as the largest single-day point loss in Dow history. But as a percentage loss that&#8217;s not even in the top 10 Bad Dow Days, all but two of which occurred before 1935. Those two since the Depression occurred on October 19 and 26, 1987, when the Dow lost 22.6% and then another 8% of its total value in single sessions, respectively #2 and #9 on All-Time Bad Dow Days list. For perspective, as of this writing the Dow is down 19.8% so far this entire year, and it surely hasn&#8217;t been a good year. Today&#8217;s crisis is already historic and could well get worse yet, of course, but some of us do remember some pretty bad ones in the past.
As good old Sam Clemens said (approximately), there are lies, darned lies, and statistics. Even when the statistics are true, always cross-check them for perspective. Even the best news and the worst news can be overstated, and viewing the same data from multiple angles helps ensure we understand it properly.
Posted in Opinion &amp; Editorial           </div></summary>
  </entry>

  <entry>
    <title>Ralph Johnson on Parallel Programming Pa</title>
    <link href="http://herbsutter.wordpress.com/2008/09/25/ralph-johnson-on-parallel-programming-patterns/"/>
    <id>http://yoursite/article/?i=df03c44cc58282b4639cdda35d833c2b</id>
    <updated>2008-09-25T21:00:03-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">A few days ago at UIUC, Ralph Johnson gave a very nice talk on &#8220;Parallel Programming Patterns.&#8221; It&#8217;s now online, and here&#8217;s the abstract:
Parallel programming is hard. One proposed solution is to provide a standard set of patterns. Learning the patterns would help people to become expert parallel programmers. The patterns would provide a vocabulary that would let programmers think about their programs at a higher level than the programming language. The patterns could steer programmers away from common errors and towards good design principles.
There have been a number of papers about parallel patterns, and one book Patterns for Parallel Programming. None of them have become popular. I think the problem is that parallel programming is diverse and requires more design expertise than traditional software design. Thus, parallel programming experts use more patterns than parallel programming expert. I&#8217;ll critique the existing patterns and explain what I think should be done to make a set of patterns that can be as effective for parallel programming as patterns have been for object-oriented design. 

If Johnson&#8217;s name sounds familiar, it should: He&#8217;s one of the &#8220;Gang of Four&#8221; authors of the seminal book Design Patterns.
Recommended viewing.
Posted in Concurrency           </div></summary>
  </entry>

  <entry>
    <title>Effective Concurrency Course: Sep 22-24,</title>
    <link href="http://herbsutter.wordpress.com/2008/09/01/effective-concurrency-course-sep-22-24-2008/"/>
    <id>http://yoursite/article/?i=ade1065d66c12d489705107c701cedc4</id>
    <updated>2008-09-01T22:00:13-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The first offering of the three-day Effective Concurrency course in May went very well. We&#8217;re doing it again later this month &#8212; this will be the last offering this year.
Here&#8217;s the brief information (more details below):
3-Day Seminar: Effective Concurrency
September 22-4, 2008Bellevue, WA, USADeveloped and taught by Herb Sutter
This course covers the fundamental tools that software developers need to write effective concurrent software for both single-core and multi-core/many-core machines. To use concurrency effectively, we must identify and solve four key challenges: 

Leverage the ability to perform and manage work asynchronously 
Build applications that naturally run faster on new hardware having more and more cores 
Manage shared objects in memory effectively to avoid races and deadlocks
Engineer specifically for high performance

This seminar will equip attendees to reason correctly about concurrency requirements and tradeoffs, to migrate existing code bases to be concurrency-enabled, and to achieve key success factors for a concurrent programming project. Most code examples in the course can be directly translated to popular platforms and concurrency libraries, including Linux, Windows, Java, .NET, pthreads, and the forthcoming ISO C++0x standard. 

Here&#8217;s a summary of what we&#8217;ll cover during the three days:
Fundamentals 

Define basic concurrency goals and requirements 
Understand applications&#8217; 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&#8211;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 

Migrating Existing Code Bases to Use Concurrency 
Near-Future Tools and Features 
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 


I hope to get to meet some of you in the Seattle area!
       </div></summary>
  </entry>

  <entry>
    <title>Effective Concurrency: Lock-Free Code</title>
    <link href="http://herbsutter.wordpress.com/2008/08/05/effective-concurrency-lock-free-code-a-false-sense-of-security/"/>
    <id>http://yoursite/article/?i=2096335536fb29ee5be2f0b59e0e4bdb</id>
    <updated>2008-08-16T04:38:43-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">DDJ posted the next Effective Concurrency column a couple of weeks earlier than usual. You can find it here: &#8220;Lock-Free Code: A False Sense of Security&#8221;, just went live on DDJ&#8217;s site, and also appears in the print magazine.
 
This is a special column in a way, because I rarely critique someone else&#8217;s published code. However, mere weeks ago DDJ itself published an article with fundamentally broken code that tried to show how to write a simplified lock-free queue. I corresponded with the author, Petru Marginean, and his main reviewer, Andrei Alexandrescu, to discuss the problems, and they have patched the code somewhat and added a disclaimer to the article. But the issues need to be addressed, and so Petru kindly let me vivisect his code in public in this column (and the next, not yet available, which will shows how to do it right).
 
From the article:
[Lock-free code is] hard even for experts. It&#8217;s easy to write lock-free code that appears to work, but it&#8217;s very difficult to write lock-free code that is correct and performs well. Even good magazines and refereed journals have published a substantial amount of lock-free code that was actually broken in subtle ways and needed correction.
To illustrate, let&#8217;s dissect some peer-reviewed lock-free code that was published here in DDJ just two months ago &#8230;

I hope you enjoy it. (Note: Yes, the title is a riff off Tom Cargill&#8217;s classic article &#8220;Exception Handling: A False Sense of Security&#8221;, one of Scott Meyers&#8217; five &#8220;Most Important C++ Non-Book Publications&#8230;Ever&#8221;.)
 
Finally, here are links to previous Effective Concurrency columns (based on the magazine print issue dates):



August 2007
The Pillars of Concurrency


September 2007
How Much Scalability Do You Have or Need?


October 2007
Use Critical Sections (Preferably Locks) to Eliminate Races


November 2007
Apply Critical Sections Consistently


December 2007
Avoid Calling Unknown Code While Inside a Critical Section


January 2007
Use Lock Hierarchies to Avoid Deadlock


February 2008
Break Amdahl&#8217;s Law!


March 2008
Going Superlinear


April 2008
Super Linearity and the Bigger Machine


May 2008
Interrupt Politely


June 2008
Maximize Locality, Minimize Contention


July 2008
Choose Concurrency-Friendly Data Structures


August 2008
The Many Faces of Deadlock


September 2008
&#8220;Lock-Free Code: A False Sense of Security&#8221;



       </div></summary>
  </entry>

  <entry>
    <title>Anon on Data</title>
    <link href="http://herbsutter.wordpress.com/2008/08/08/anon-on-data/"/>
    <id>http://yoursite/article/?i=e637118754d05968959c4ad5572ab04b</id>
    <updated>2008-08-08T07:30:03-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The adage, quoted again this week by Bruce Schneier:
The plural of &#8220;anecdote&#8221; is not &#8220;data.&#8221;

But lest we enshrine raw data as holy in itself, another perspective:
And the plural of &#8220;datum&#8221; is not &#8220;proof.&#8221;

       </div></summary>
  </entry>

  <entry>
    <title>Embedded Multicore Development Webinar w</title>
    <link href="http://herbsutter.wordpress.com/2008/08/06/embedded-multicore-development-webinar-with-lee-reinders-and-truchard/"/>
    <id>http://yoursite/article/?i=b020b96fc551ec4e0d7f228ef0c2a44b</id>
    <updated>2008-08-06T13:30:05-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Last month, I was privileged to be part of a panel in a webinar on Embedded Multicore Development moderated by Richard Nass, Editor-in-Chief of Embedded Systems Design, Embedded.com, and the Embedded Systems Conferences. It&#8217;s online and available on demand.
I say &#8220;privileged&#8221; especially because of the stature of the other panelists. These distinguished gentlemen were:

Edward A. Lee, Professor and Chair of the EE&amp;CS department at U.C. Berkeley, and known among other things for &#8220;The Problem with Threads&#8221;.
James Reinders, the chief concurrency evangelist at Intel and author of the Threading Building Blocks book.
James Truchard, the co-founder, President and CEO of National Instruments.

It was a fun discussion, and I hope informative.
       </div></summary>
  </entry>

  <entry>
    <title>Server Concurrency != Client Concurrency</title>
    <link href="http://herbsutter.wordpress.com/2008/08/01/server-concurrency-client-concurrency/"/>
    <id>http://yoursite/article/?i=3773e401e3eb6382c34bf2df257860ae</id>
    <updated>2008-08-01T16:00:07-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Today I received an email that asked:

I have recently come across your excellent articles on concurrency and the changes in software writing paradigm. They make a lot of sense, but I am having trouble translating them to my world of Telecom oriented web services, where practically everything is run through a DBMS. It seems to me we get everything ?free?, simply by using an inherently concurrent multi-everything beast such as that :-) .
Could you please share your thoughts on the issue in one of your coming blog entries? It seems to me nowadays most complex systems would take advantage of a DBMS, certainly any application that is internet based, telecom oriented, or enterprise level. Be it in C++, Java, or PHP and its ilk, using a DBMS - often as a sort of message queue ? is one of the best practices that ensures parallelism. 

Sure. At right is a slide I give in talks that summarizes the answer to this question, and I&#8217;ve addressed this and other similar issues in an ACM Queue article.
The problem with taking advantage of multicore/manycore hardware isn?t (as much) is not on the server, it&#8217;s on the client. When experienced people say things like, &#8220;but the concurrency problem is already solved, we&#8217;ve been building scalable software for years,&#8221; that&#8217;s server or niche-application people talking. That kind of laid-back sound bite sure isn&#8217;t coming from mainstream client application developers.
Typical Server Workloads
On the server:

Workloads typically already have lots of inherent concurrency (000s or 000,000s of incoming requests for web/dbms/etc. operations), and it&#8217;s easy to launch independent requests concurrently.
Shared data is typically inside highly structured relational databases where we have decades of experience with automatic concurrency control. The DBMS itself knows how to optimistically run transactions in parallel and control conflicts by taking row locks or page locks, escalating row locks to page locks, escalating index locks to tables locks, and so on.
The programming model is typically transactions, and all the programmer has to know about is to write &#8220;begin transaction; /* &#8230; read/write whatever stuff you feel the need to, then &#8230; */ end transaction;&#8221; which is about as sweet as it gets.

We already know how to build somewhat scalable server apps. Sure, it?s still rocket science and takes expert knowledge to do well. But we generally know the rocket science, have experts who can implement it with repeatable success, and have regularly scheduled missions to the ?scalable servers? space station. With some care, we can say that the &#8220;concurrency problem is already solved&#8221; here.
Typical Client Workloads
The world is very different for typical mainstream client applications (i.e., I&#8217;m not talking about Photoshop and a handful of others), where:

Workloads don?t have lots of inherent concurrency. The user clicks one button, and we have to figure out how to divide the work and recombine it in order to get the answer faster on many cores.
Shared data is typically in unstructured pointer-chasing graphs of objects in shared memory. Note that &#8220;unstructured&#8221; doesn&#8217;t mean there&#8217;s no structure &#8212; of course there&#8217;s some &#8212; but it&#8217;s a gloriously diverse pile of objects and containers, and more like an organically growing shantytown with unplanned twisty little alleys and passages, than the nice rectangular downtown city street plan of a nice rectangular database table.
The programming model to protect shared data is to use error-prone explicit locks. You have to remember which locks protect which data, and not to acquire them in inconsistent and deadlock-prone orders.

We?re still discovering and productizing the rocket science here. You could say that the tools like OpenMP that we do have now are still at the V-2 stage (limited applicability, somewhat fussy, don?t always land where you aim them).
But we&#8217;re working on it. Up-and-coming tools like Threading Building Blocks are like the Mercury and Venera missions, setting out to reach successively higher goals and repeatability&#8230; and we&#8217;re starting to see what are perhaps Apollo- and ISS-class missions in the form of PLINQ, the Task Parallel Library, and one for native C++ we&#8217;ll be announcing in October at PDC. In part, these tools are trying to see how much we can make client workloads look more like server workloads, notably in providing a transaction-oriented programming model. For example, transactional memory is an area of active research that would let us write &#8220;begin transaction; /* &#8230; read/write whatever memory variables you feel the need to, then &#8230; */ end transaction;&#8221;, and if successful it could eventually replace many or even more existing uses of locks.
We have rightly celebrated some successful &#8216;manned&#8217; flights with client products like Photoshop (parallel rendering) and Excel (parallel recalc) that scale to a number of cores. We?re on the road toward, but still working toward, establishing the infrastructure and technology base to enable regularly scheduled commercial flights/shipments of scalable client applications that &#8220;light up&#8221; on multicore/manycore machines.
       </div></summary>
  </entry>

  <entry>
    <title>Effective Concurrency: The Many Faces of</title>
    <link href="http://herbsutter.wordpress.com/2008/07/31/effective-concurrency-the-many-faces-of-deadlock/"/>
    <id>http://yoursite/article/?i=79357be3bb32df57a7ef6a08ec9f6ab7</id>
    <updated>2008-07-31T10:00:06-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The latest Effective Concurrency column, &#8220;The Many Faces of Deadlock&#8221;, just went live on DDJ&#8217;s site, and also appears in the print magazine. From the article:
&#8230; That&#8217;s the classic deadlock example from college. Of course, two isn&#8217;t a magic number. An improved definition of deadlock is: &#8220;When N threads enter a locking cycle where each tries to take a lock the next already holds.&#8221;
&#8220;But wait,&#8221; someone might say. &#8220;I once had a deadlock just like the code you just showed, but it didn&#8217;t involve locks at all?it involved messages.&#8221; &#8230;

I hope you enjoy it.
 
Finally, here are links to previous Effective Concurrency columns (based on the magazine print issue dates):



August 2007
The Pillars of Concurrency


September 2007
How Much Scalability Do You Have or Need?


October 2007
Use Critical Sections (Preferably Locks) to Eliminate Races


November 2007
Apply Critical Sections Consistently


December 2007
Avoid Calling Unknown Code While Inside a Critical Section


January 2007
Use Lock Hierarchies to Avoid Deadlock


February 2008
Break Amdahl&#8217;s Law!


March 2008
Going Superlinear


April 2008
Super Linearity and the Bigger Machine


May 2008
Interrupt Politely


June 2008
Maximize Locality, Minimize Contention


July 2008
Choose Concurrency-Friendly Data Structures


August 2008
The Many Faces of Deadlock



       </div></summary>
  </entry>

  <entry>
    <title>Constructor Exceptions in C++, C#, and J</title>
    <link href="http://herbsutter.wordpress.com/2008/07/25/constructor-exceptions-in-c-c-and-java/"/>
    <id>http://yoursite/article/?i=e5019e6c91f343da76a464901c76d87c</id>
    <updated>2008-07-25T13:30:07-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">I just received the following question, whose answer is the same in C++, C#, and Java.
Question: In the following code, why isn&#8217;t the destructor/disposer ever called to clean up the Widget when the constructor emits an exception? You can entertain this question in your mainstream language of choice:



// C++ (an edited version of the original code// that the reader emailed me) 
class Gadget {   Widget* w;
public:   Gadget() {     w = new Widget();     throw new exception();     // &#8230; or some API call might throw   };
   ~Gadget() {      if( w != nullptr ) delete w;   }};



// C# (equivalent) 
class Gadget : IDisposable {   private Widget w;
   public Gadget() {     w = new Widget();     throw new Exception();     // &#8230; or some API call might throw   };
   public void Dispose() {     // &#8230; eliding other mechanics, eventually calls:     if( w != null ) w.Dispose();     // or just &#8220;w = null;&#8221; if Widget isn&#8217;t IDisposable   }};



// Java (equivalent) 
class Gadget {   private Widget w;
   public Gadget() {     w = new Widget();     throw new Exception();     // &#8230; or some API call might throw   };
   public void dispose() {     if( w != null ) w.dispose();     // or just &#8220;w = null;&#8221; if Widget isn&#8217;t disposable   }};




Interestingly, we can answer this even without knowing the calling code&#8230; but there is typical calling code that is similar in all three languages that reinforces the answer.
Construction and Lifetime
The fundamental principles behind the answer is the same in C++, C#, and Java:

A constructor conceptually turns a suitably sized chunk of raw memory into an object that obeys its invariants. An object&#8217;s lifetime doesn&#8217;t begin until its constructor completes successfully. If a constructor ends by throwing an exception, that means it never finished creating the object and setting up its invariants &#8212; and at the point the exceptional constructor exits, the object not only doesn&#8217;t exist, but never existed.
A destructor/disposer conceptually turns an object back into raw memory. Therefore, just like all other nonprivate methods, destructors/disposers assume as a precondition that &#8220;this&#8221; object is actually a valid object and that its invariants hold. Hence, destructors/disposers only run on successfully constructed objects.

I&#8217;ve covered some of these concepts and consequences before in GotW #66, &#8220;Constructor Failures,&#8221; which appeared in updated and expanded form as Items 17 and 18 of More Exceptional C++.
In particular, if Gadget&#8217;s constructor throws, it means that the Gadget object wasn&#8217;t created and never existed. So there&#8217;s nothing to destroy or dispose: The destructor/disposer not only isn&#8217;t needed to run, but it can&#8217;t run because it doesn&#8217;t have a valid object to run against.
Incidentally, it also means that the Gadget constructor isn&#8217;t exception-safe, because it and only it can clean up resources it might leak. In the C++ version, the usual simple way to write the code correctly is to change the w member&#8217;s type from Widget* to shared_ptr&lt;Widget&gt; or an equivalent smart pointer type that owns the object. But let&#8217;s leave that aside for now to explore the more general issue.
A Look At the Calling Code
Next, let&#8217;s see how these semantics are actually enforced, whether by language rules or by convention, on the calling side in each language. Here are the major idiomatic ways in each language to use an Gadget object in an exception-safe way:




// C++ caller, variant 1: stack allocation
{  Gadget myGadget;  // do something with myGadget}




// C# caller
using( Gadget myGadget = new Gadget() ){  // do something with myGadget}




// Java caller
Gadget myGadget = new Gadget();
try {  // do something with myGadget}finally {  myGadget.dispose();}




Consider the two cases where an exception can occur:

What if an exception is thrown while using myGadget &#8211; that is, during &#8220;do something with myGadget&#8221;? In all cases, we know that myGadget&#8217;s destructor/dispose method is guaranteed to be called.
But what if an exception is thrown while constructing myGadget? Now in all cases the answer is that the destructor/dispose method is guaranteed not to be called.

Put another way, we can say for all cases: The destructor/dispose is guaranteed to be run if and only if the constructor completed successfully.
Another Look At the Destructor/Dispose Code
Finally, let&#8217;s return to each key line of code one more time:



// C++ 
      if( w != nullptr ) delete w;



// C# 
     if( w != null ) w.Dispose();



// Java 
     if( w != null ) w.dispose();




The motivation for the nullness tests in the original example was to clean up partly-constructed objects. That motivation is suspect in principle &#8212; it means the constructors aren&#8217;t exception-safe because only they can clean up after themselves &#8212; and as we&#8217;ve seen it&#8217;s flawed in practice because the destructors/disposers won&#8217;t ever run on the code paths that the original motivation cared about. So we don&#8217;t need the nullness tests for that reason, although you might still have nullness tests in destructors/disposers to handle &#8216;optional&#8217; parts of an object where a valid object might hold a null pointer or reference member during its lifetime.
In this particular example, we can observe that the nullness tests are actually unnecessary, because w will always be non-null if the object was constructed successfully. There is no (legitimate) way that you can call the destructor/disposer (Furthermore, C++ developers will know that the test is unnecessary for a second reason: Delete is a no-op if the pointer passed to it is null, so there&#8217;s never a need to check for that special case.)
Conclusion
When it comes to object lifetimes, all OO languages are more alike than different. Object and resource lifetime matters, whether or not you have a managed language, garbage collection (finalizers are not destructors/disposers!), templates, generics, or any other fancy bell or whistle layered on top of the basic humble class.
The same basic issues arise everywhere&#8230; the code you write to deal with them is just spelled using different language features and/or idioms in the different languages, that&#8217;s all. We can have lively discussions about which language offers the easiest/best/greenest/lowest-carbon-footprint way to express how we want to deal with a particular aspect of object construction, lifetime, and teardown, but those concerns are general and fundamental no matter which favorite language you&#8217;re using to write your code this week.
       </div></summary>
  </entry>

  <entry>
    <title>Research Firms Are Good At Research, Not</title>
    <link href="http://herbsutter.wordpress.com/2008/07/21/research-firms-are-good-at-research-not-technology-predictions/"/>
    <id>http://yoursite/article/?i=f62d9083a230a5cd53c696fd4ab37cd9</id>
    <updated>2008-07-21T08:30:04-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">This story has been picked up semi-widely since last night. I&#8217;m sure this Steven Prentice they quote is a fine (Gartner) Fellow, but really:
The computer mouse is set to die out in the next five years and will be usurped by touch screens and facial recognition, analysts believe.

Seriously, does anyone who uses computers daily really believe this kind of prediction just because someone at Gartner says so? Dude, sanity check: 1. What functions do you use your mouse for? 2. How many of those functions can be done by pointing at your screen or smiling at the camera: a) at all; and b) with equivalent high precision and low arm fatigue? Of course the mouse, including direct equivalents like the touchpad/trackpad, will be replaced someday. But to notice that people like to turn and shake their Wii controllers and iPhones and then make the leap to conclude that this will replace mice outright seems pretty thin even for Gartner.
When you read a report from Gartner, Forrester, IDC and their brethren research firms, remember that you&#8217;re either getting real-world data (aka research) or a single analyst&#8217;s personal predictions (aka crystal-ball gazing). Research firms are good at what they&#8217;re good at, namely research:

They&#8217;re &#8220;decent&#8221; at compiling current industry market data. Grade: A.
They&#8217;re &#8220;pretty okay&#8221; when they limit themselves to simple short-term extrapolation of that data, such as two-year projections of cost changes of high-speed networking in Canada or cell phone penetration in India. Grade: A-.

But when they try bigger technology movement predictions like &#8220;X will replace Y in Z years&#8221; they average somewhere around &#8220;spotty,&#8221; and on their off days they dip down into &#8220;I think you forgot to sanity check that sound bite&#8221; territory. It&#8217;s a pity that some venture capitalists take the research analysts&#8217; word as gospel. Reliability of technology shift predictions: D+.
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/08/31/plug-for-the-astoria-seminar/"/>
    <id>http://yoursite/article/?i=f2420031eed8f8dc8413052ede1fa536</id>
    <updated>2008-07-18T12:00:16-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/08/11/more-visual-c-qa-a-new-compiler-front-end/"/>
    <id>http://yoursite/article/?i=b99a128c7a9b704b7c285838d416bb4b</id>
    <updated>2008-07-18T12:00:16-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/08/09/a-not-so-innocent-diversion-trial-by-media/"/>
    <id>http://yoursite/article/?i=c913caa9daa25bec49523bc839e4dd1c</id>
    <updated>2008-07-18T12:00:16-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/08/08/visual-c-qa/"/>
    <id>http://yoursite/article/?i=ab59f7d4a62518da82b3e1ee875140b6</id>
    <updated>2008-07-18T12:00:16-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/09/13/webcast-via-intel-on-september-25/"/>
    <id>http://yoursite/article/?i=22aec66af5b29ddea1ef9bb48599bf52</id>
    <updated>2008-07-18T12:00:15-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/09/10/trip-report-july-2007-iso-c-standards-meeting/"/>
    <id>http://yoursite/article/?i=f14603e4a64b6098fc4d5b602a38831e</id>
    <updated>2008-07-18T12:00:15-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/09/05/effective-concurrency-use-critical-sections-preferably-locks-to-eliminate-races/"/>
    <id>http://yoursite/article/?i=e12600cf21e462e257f0c1916f31ab97</id>
    <updated>2008-07-18T12:00:15-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/12/01/the-concurrency-land-rush-2007-20/"/>
    <id>http://yoursite/article/?i=668a74b95b0f63bc2a5cee4901a9c87a</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/11/30/concurrency-town-hall-on-the-web-this-monday-december-3/"/>
    <id>http://yoursite/article/?i=31dc8e8e94c04be1a785329c7343bea6</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/11/10/visual-c-announcements-in-barcelona-tr1-and-mfc/"/>
    <id>http://yoursite/article/?i=31cafea4323c7143ffd40b5a0802a9ae</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/11/06/effective-concurrency-avoid-calling-unknown-code-while-inside-a-critical-section/"/>
    <id>http://yoursite/article/?i=6d1ed8d9f72e362a36ecb6f7cbb3b9f6</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/11/01/trip-report-october-2007-iso-c-standards-meeting/"/>
    <id>http://yoursite/article/?i=46dd049cd8cf0b5e72b1e5dbeb36a560</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/10/10/effective-concurrency-apply-critical-sections-consistently/"/>
    <id>http://yoursite/article/?i=58f1db3579ce96c38cd7bb16fcf7680c</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/09/29/jefferson-on-luck/"/>
    <id>http://yoursite/article/?i=da5313ab2cb6a8269c3b4dd30c317c60</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/09/24/suggestion-for-required-viewing-machine-architecture-talk-online/"/>
    <id>http://yoursite/article/?i=d24ae3c13545e9811df480dfe506a291</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/09/16/omit-needless-words-in-c/"/>
    <id>http://yoursite/article/?i=ccaaf9fcb5f75e5bb9ba7a49ff14fdcd</id>
    <updated>2008-07-18T12:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/01/17/effective-concurrency-break-amdahls-law/"/>
    <id>http://yoursite/article/?i=4408fa5f1f189e000ce71a2198693200</id>
    <updated>2008-07-18T12:00:13-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/"/>
    <id>http://yoursite/article/?i=ec19ddf0725cc5dbf0b8797606203bc3</id>
    <updated>2008-07-18T12:00:13-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/12/11/effective-concurrency-use-lock-hierarchies-to-avoid-deadlock/"/>
    <id>http://yoursite/article/?i=afa2b71796a73a9fabde4cfdd09cd9b2</id>
    <updated>2008-07-18T12:00:13-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/12/07/lets-be-thoughtful-out-there/"/>
    <id>http://yoursite/article/?i=04a30e969ad7062e8e564be5c7797f6a</id>
    <updated>2008-07-18T12:00:13-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/12/05/tr1-in-free-vc-express/"/>
    <id>http://yoursite/article/?i=ce5ad165dd1176f25610f6dcf0943cb7</id>
    <updated>2008-07-18T12:00:13-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2007/12/01/parallel-computing-releases-at-microsoft/"/>
    <id>http://yoursite/article/?i=da2d14d584fba1e2a2fe5090e635000a</id>
    <updated>2008-07-18T12:00:13-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/01/30/effective-concurrency-going-superlinear/"/>
    <id>http://yoursite/article/?i=8e4e9e4261822552fce7c34f792421f2</id>
    <updated>2008-07-18T12:00:12-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/01/28/what-not-to-code/"/>
    <id>http://yoursite/article/?i=3c46760e655f25fc48a79549e39fd4fe</id>
    <updated>2008-07-18T12:00:12-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/01/25/many-books/"/>
    <id>http://yoursite/article/?i=ca2b2f0aa2039e27660372959669becc</id>
    <updated>2008-07-18T12:00:12-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/01/22/stroustrup-sutter-on-c-march-3-4-2008-in-santa-clara-ca-usa/"/>
    <id>http://yoursite/article/?i=c7f1ee3f696b56aab95d6128d017e90c</id>
    <updated>2008-07-18T12:00:12-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/01/18/newton-on-tact/"/>
    <id>http://yoursite/article/?i=8d2ce5288f506a1904834e9b73c523f0</id>
    <updated>2008-07-18T12:00:12-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/04/10/effective-concurrency-interrupt-politely/"/>
    <id>http://yoursite/article/?i=a87a7ecd50fe0ba013ef212343d454d4</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/04/07/cringe-not-vectors-are-guaranteed-to-be-contiguous/"/>
    <id>http://yoursite/article/?i=0e1267c4123b9c770333fbd39e1e520f</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/04/07/visual-c-2008-feature-pack-now-available/"/>
    <id>http://yoursite/article/?i=3c2332eedcf28b3af6eb80d32073275d</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/03/29/trip-report-februarymarch-2008-iso-c-standards-meeting/"/>
    <id>http://yoursite/article/?i=5137706468119aec0800ad7ebddc6424</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/03/28/concurrency-interview-with-devx/"/>
    <id>http://yoursite/article/?i=9fa7874cf63062d868ecdac0b5ddc3f8</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/03/12/new-course-available-effective-concurrency/"/>
    <id>http://yoursite/article/?i=fb90e023e3bc1b04b033daa7f0c15ca8</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/03/12/effective-concurrency-super-linearity-and-the-bigger-machine/"/>
    <id>http://yoursite/article/?i=cd485afc92f26b35ebce52f1dcc45d4b</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/03/10/stroustrup-sutter-the-lyrics/"/>
    <id>http://yoursite/article/?i=47ca4fe35b1ca040facc1f107b6b6966</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/02/01/how-parallelism-demos-are-useful/"/>
    <id>http://yoursite/article/?i=a5f628369ecab930d81b304b67c4ec49</id>
    <updated>2008-07-18T12:00:11-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/05/23/effective-concurrency-maximize-locality-minimize-contention/"/>
    <id>http://yoursite/article/?i=0b10c3213f11a33ebe7f72ed28f34798</id>
    <updated>2008-07-18T12:00:10-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/05/08/part-2-of-concurrency-interview-with-devx/"/>
    <id>http://yoursite/article/?i=47bc23f9880f302ce5c8dedcf78f98a7</id>
    <updated>2008-07-18T12:00:10-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/04/23/where-to-find-the-state-of-iso-c-evolution/"/>
    <id>http://yoursite/article/?i=99023cb9317fade7e266b6639fe93c33</id>
    <updated>2008-07-18T12:00:10-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/04/18/quad-core-a-waste-of-electricity/"/>
    <id>http://yoursite/article/?i=e99f20db9f1aae8b094b4e638ac77a46</id>
    <updated>2008-07-18T12:00:10-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/04/11/usability-watch-out-for-those-non-errors-that-start-with-er/"/>
    <id>http://yoursite/article/?i=797ab4526a09288b9b1c80206bec3b0e</id>
    <updated>2008-07-18T12:00:10-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/06/27/seneca-and-shakespeare-on-goals-and-opportunities/"/>
    <id>http://yoursite/article/?i=ee107801256c8feaf6bb4791c6269ce6</id>
    <updated>2008-07-18T12:00:09-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/06/20/talking-lambdas-with-bill-gates-on-bbc/"/>
    <id>http://yoursite/article/?i=da6b44b961cfed5d5df105387c8efffa</id>
    <updated>2008-07-18T12:00:09-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/"/>
    <id>http://yoursite/article/?i=3906b90fb62c448d32ed8cf16bd66fa5</id>
    <updated>2008-07-18T12:00:09-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/06/10/stroustrup-sutter-on-c-the-interviews/"/>
    <id>http://yoursite/article/?i=51dfd55a0e33043b69e23689446dabc1</id>
    <updated>2008-07-18T12:00:09-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/06/10/memory-model-talk-at-gamefest-2008/"/>
    <id>http://yoursite/article/?i=0b1f005246582c8419cbcef4f86b0bb3</id>
    <updated>2008-07-18T12:00:09-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/07/15/hungarian-notation-is-clearly-goodbad/"/>
    <id>http://yoursite/article/?i=89a0bef345cc5ad143bf7bce4785d93c</id>
    <updated>2008-07-18T12:00:08-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/07/04/trip-report-june-2008-iso-c-standards-meeting/"/>
    <id>http://yoursite/article/?i=d50e9c60658f9082e4045f4bfd108cbd</id>
    <updated>2008-07-18T12:00:08-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/06/27/effective-concurrency-choose-concurrency-friendly-data-structures/"/>
    <id>http://yoursite/article/?i=a66dd48c272631490ccf944eee17e3b9</id>
    <updated>2008-07-18T12:00:08-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title></title>
    <link href="http://herbsutter.wordpress.com/2008/07/16/kindling/"/>
    <id>http://yoursite/article/?i=11dc3faf00ebe30e91a4d76857202e4c</id>
    <updated>2008-07-18T12:00:07-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">
       </div></summary>
  </entry>

  <entry>
    <title>Kindling</title>
    <link href="http://herbsutter.wordpress.com/2008/07/16/kindling/"/>
    <id>http://yoursite/article/?i=d6fd511f9520448d6b2e4ef9c243d5e7</id>
    <updated>2008-07-16T19:00:06-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Two weeks ago, I broke down and bought a Kindle. I like it:

It&#8217;s a good and well-designed reader, and the experience is much better than the other e-book reading I&#8217;ve done before on phones and PDAs. I like how you when you bookmark a page, you can see it&#8230; the corner of the page gets a little dog-ear. [1]
It&#8217;s got a nice e-paper screen that uses ambient light, not backlight, which makes it readable anywhere just like a printed page &#8212; it&#8217;s even better, not worse, in direct sunlight.
It&#8217;s light and thin and sturdy. Sure beats carrying three or four books on a trip.
It has great battery life. I&#8217;ve only charged it once so far, when I first received it&#8230; since then I&#8217;ve had it for 11 days and read a full book and a half, and it still has 75% of its first charge left. (It helps that I turn the wireless off unless I&#8217;m actively using it.)
Fast, free wireless everywhere in the U.S., without computers or WiFi.

But today, it transformed my reading experience.
This morning, I was unsuspectingly reading my feeds in Google Reader as usual, blissfully unaware that the way I read books was about to change. Among other articles, I noticed that Slashdot ran a book review of Inside Steve&#8217;s Brain (that&#8217;s Jobs, not Wozniak or Ballmer). The review made me want to read the book. That&#8217;s when the new reality started, because I was interested in the book now, and had time to start reading it now:

Normally, I would have ordered it from Amazon and waited for it to arrive. But what usually happens then is that the book arrives a week later, and when it gets here I don&#8217;t have time to start it right away or I don&#8217;t quite feel like that kind of book just at the moment&#8230; and it goes on a shelf, with a 70% probably of being picked up at some point in the future.
Today, I searched for the book title on my Kindle, clicked &#8220;Buy&#8221;, and a few minutes later started reading Inside Steve&#8217;s Brain while eating lunch. [2]

That convenience isn&#8217;t merely instant gratification, it&#8217;s transformative. I suspect I&#8217;m going to be buying reading even more books now, even though I have a few little nits with the device, such as that the next and previous page buttons are a little too easy to press in some positions.
In other news, the Kindle also supports reading blogs and newspapers and some web surfing, but those are less compelling for me because I tend to do those things in the context of work, which means I&#8217;m already sitting at a computer with a bigger color screen and full keyboard. Maybe someday I&#8217;ll do it on e-paper. Until then, just living inside a virtual bookstore is plenty for me. Kindle + the Amazon Kindle store = iPod + iTunes for books. [3]
Here&#8217;s a useful summary article on Kindle features from a prospective user&#8217;s point of view
Notes
1. The first two books I downloaded? The Design of Everyday Things, which was interestingly apropros to read on a new device like the Kindle with its nice dog-ear feedback and other well-designed features, and Foundation, which I hadn&#8217;t read in ages.
2. And it cost less than half what the dead-tree version would (though the latter was hardcover).
3. Caveat: I&#8217;m not actually an iPod owner, and I hate how Apple keeps insisting on installing iTunes on my computer just because I have Safari installed (mutter grumble evil product-tying monopolies mutter grumble). But apparently everyone else loves them, and they have indeed changed their industry.
       </div></summary>
  </entry>

  <entry>
    <title>Hungarian Notation Is Clearly (Good|Bad)</title>
    <link href="http://herbsutter.wordpress.com/2008/07/15/hungarian-notation-is-clearly-goodbad/"/>
    <id>http://yoursite/article/?i=adabdb4e6ae8dad3d753bcb0719ee122</id>
    <updated>2008-07-15T13:00:10-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">A commenter asked:
thread_local X tlsX; ??
Herb, I hope you aren?t backtracking on Hungarian Notation now that you work for Microsoft. Say it aint so?

It ain&#8217;t so. Besides, Microsoft&#8217;s Framework Developer&#8217;s Guide prominently intones: &#8220;Do not use Hungarian notation.&#8221;
Warts like &#8220;tls&#8221; and &#8220;i&#8221; are about lifetime and usage, not type. Here &#8220;tls&#8221; denotes that each thread gets its own copy of the value that is constructed and destroyed once per thread that uses it (lifetime) and doesn&#8217;t need to be synchronized using mutexes (usage). As another example of usage warts, I&#8217;ll also use &#8220;i&#8221; for a variable that&#8217;s used as an index or for iteration &#8212; and given that the &#8220;i&#8221; convention goes back to before BASIC, we shouldn&#8217;t try to pin the Hungarian tail on that donkey.
Having said that, though, many people have variously decried and defended different forms of Hungarian, and you may notice a pattern&#8230; they&#8217;re mostly:

decrying Systems Hungarian, the wildly popularized version which focuses on encoding the type, and 
defending Applications Hungarian, the originally described version which focuses on encoding the usage.

Today, &#8220;Hungarian&#8221; nearly always means Systems Hungarian. The main trouble with Systems Hungarian comes from trying to embed information about a variable&#8217;s type into the variable&#8217;s name by prepending an encoded wart like the venerable sz, pach, ul, and their ilk. Although potentially helpful in a weakly-typed language like C, that&#8217;s known to be brittle and the prefixes tend to turn into lies as variable types morph during maintenance. The warting systems also don&#8217;t extend well to user-defined types and templates.
I&#8217;ve railed against the limitations and perils of Hungarian with Andrei Alexandrescu in our book C++ Coding Standards, where I made sure it was stated right up front as part of &#8220;Item 0: Don&#8217;t sweat the small stuff (or, Know what not to standardize)&#8221;:
Example 3: Hungarian notation. Notations that incorporate type information in variable names have mixed utility in type-unsafe languages (notably C), are possible but have no benefits (only drawbacks) in object-oriented languages, and are impossible in generic programming. Therefore, no C++ coding standard should require Hungarian notation, though a C++ coding standard might legitimately choose to ban it. 

and with Jim Hyslop in our article &#8220;Hungarian wartHogs&#8221;:
&#8220;&#8230; the compiler already knows much more than you do about an object&#8217;s type. Changing the variable&#8217;s name to embed type information adds little value and is in fact brittle. And if there ever was reason to use some Hungarian notation in C-style languages, which is debatable, there certainly remains no value when using type-safe languages.&#8221;

There&#8217;s an amusing real-world note later in that article. I&#8217;ll pick up where the Guru is saying:
&#8220;I recall only one time when Hungarian notation was useful on a project. &#8230; One of the programmers on the project was named Paul,&#8221; the Guru explained. &#8220;Several months into the project, while still struggling to grow a ponytail and build his report-writing module, he pointed out that Hungarian notation had helped him find a sense of identity, for he now knew what he was&#8230;&#8221; She paused.
I blinked. It took me about ten seconds, and then I shut my eyes and grimaced painfully. &#8220;Pointer to array of unsigned long,&#8221; I groaned.
She smiled, enjoying my pain. &#8220;True story,&#8221; she said.

It is indeed a true story. I worked with him in 1993. The joke was bad then, too, but at least using Hungarian was more defensible because the project&#8217;s code was written in C. I found it handy at the time, but now that I work in more strongly typed languages I find the type-embedding version of Hungarian more actively harmful than actually useful.
You might call me a Hungarian emigrant, now living happily as an expat out in eastern C++ near the Isle of Managed Languages.
       </div></summary>
  </entry>

  <entry>
    <title>Trip Report: June 2008 ISO C++ Standards</title>
    <link href="http://herbsutter.wordpress.com/2008/07/04/trip-report-june-2008-iso-c-standards-meeting/"/>
    <id>http://yoursite/article/?i=0de45884d849ee02040d4bd0830ba077</id>
    <updated>2008-07-04T10:00:05-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The ISO C++ committee met in Sophia Antipolis, France on June 6-14. You can find the minutes here (note that these cover only the whole-group sessions, not the breakout technical sessions where we spend most of the week).
Here?s a summary of what we did, with links to the relevant papers to read for more details, and information about upcoming meetings.
Highlights: Complete C++0x draft coming in September
The biggest goal entering this meeting was to make C++0x feature-complete and stay on track to publish a complete public draft of C++0x this September for international review and comment &#8212; in ISO-speak, an official Committee Draft or CD. We are going to achieve that, so the world will know the shape of C++0x in good detail this fall.
We&#8217;re also now planning to have two rounds of international comment review instead of just one, to give the world a good look at the standard and two opportunities for national bodies to give their comments, the first round starting after our September 2008 meeting and the second round probably a year later. However, the September 2008 CD is &#8220;it&#8221;, feature-complete C++0x. The only changes expected to be made between that CD and the final International Standard are bug fixes and clarifications. It&#8217;s helpful to think of a CD as a feature-complete beta.
Coming into the June meeting, we already had a nearly-complete C++0x internal working draft &#8212; most features that will be part of C++0x had already been &#8220;checked in.&#8221; Only a few were still waiting to become stable enough to vote in, including initializer lists, range-based for loops, and concepts.
Of these, concepts is the long-pole feature for C++0x, which isn&#8217;t surprising given that it&#8217;s the biggest new language feature we&#8217;re adding to Standard C++. A primary goal of the June meeting, therefore, was to make as much progress on concepts as possible, and to see if it would be possible to vote that feature into the C++0x working draft at this meeting. We almost did that, thanks to a lot of work not only in France but also at smaller meetings throughout the winter and spring: For the first time, we ended a meeting with no known issues or controversial points in the concepts standardese wording, and we expect to &#8220;check in&#8221; concepts into the working draft at the next meeting in September, which both cleared the way for us to publish a complete draft then and motivated the plan to do two rounds of public review rather than one, just to make sure the standard got enough &#8220;bake time&#8221; in its complete form.
Next, I&#8217;ll summarize some of the major features voted into the draft at the June meeting.
Initializer lists
C++0x initializer lists accomplish two main objectives:

Uniformity: They provide a uniform initialization syntax you can use consistently everywhere, which is especially helpful when you write templates.
Convenience: They provide a general-purpose way of using the C initializer syntax for all sorts of types, notably containers.

See N2215 for more on the motivation and original design, and N2672 and N2679 for the final standardese.
Example: Initializing aggregates vs. classes
It&#8217;s convenient that we can initialize aggregates like this:



struct Coordinate1 {  int i;  int j;  //&#8230;};
Coordinate1 c1 = { 1, 2 };



but the syntax is slightly different for classes with constructors:



class Coordinate2 {public:  Coordinate2( int i, int j );  // &#8230;};
Coordinate2 c2( 1, 2 );



In C++0x, you can still do all of the above, but initializer lists give us a regular way to initialize all kinds of types:



Coordinate1 c1 = { 1, 2 };Coordinate2 c2 = { 1, 2 }; // legal in C++0x



Having a uniform initialization syntax is particularly helpful when writing template code, so that the template can easily work with a wide variety of types.
Example: Initializing arrays vs. containers
One place where the lack of uniform initialization has been particularly annoying &#8212; at least to me, when I write test harnesses to exercise the code I show in articles and talks &#8212; is when initializing a container with some default values. Don&#8217;t you hate it when you want to create a container initialized to some known values, and if it were an array you can just write:



string a[] = { &#8220;xyzzy&#8221;, &#8220;plugh&#8221;, &#8220;abracadabra&#8221; };



but if it&#8217;s a container like a vector, you have to default-construct the container and then push every entry onto it individually:



// Initialize by hand todayvector&lt;string&gt; v;v.push_back( &#8220;xyzzy&#8221; );v.push_back( &#8220;plugh&#8221; );v.push_back( &#8220;abracadabra&#8221; );



or, even more embarrassingly, initialize an array first for convenience and then construct the vector as a copy of the array, using the vector constructor that takes a range as an iterator pair:



// Initialize via an array todaystring a[] = { &#8220;xyzzy&#8221;, &#8220;plugh&#8221;, &#8220;abracadabra&#8221; }; // put it into an array firstvector&lt;string&gt; v( a, a+3 ); // then construct the vector as a copy



Arrays are weaker than containers in nearly every other way, so it&#8217;s annoying that they get this unique convenience just because of their having been built into the language since the early days of C.
The lack of convenient initialization has been even more irritating with maps:



// Initialize by hand todaymap&lt;string,string&gt; phonebook;phonebook[ "Bjarne Stroustrup (cell)" ] = &#8220;+1 (212) 555-1212&#8243;;phonebook[ "Tom Petty (home)" ] = &#8220;+1 (858) 555-9734&#8243;;phonebook[ "Amy Winehouse (agent)" ] = &#8220;+44 20 74851424&#8243;;



In C++0x, we can initialize any container with known values as conveniently as arrays:



// Can use initializer list in C++0xvector&lt;string&gt; v = { &#8220;xyzzy&#8221;, &#8220;plugh&#8221;, &#8220;abracadabra&#8221; };map&lt;string,string&gt; phonebook =  { { &#8220;Bjarne Stroustrup (cell)&#8221;, &#8220;+1 (212) 555-1212&#8243; },    { &#8220;Tom Petty (home)&#8221;, &#8220;+1 (858) 555-9734&#8243; },    { &#8220;Amy Winehouse (agent)&#8221;, &#8220;+44 99 74855424&#8243; } };



As a bonus, a uniform initialization syntax even makes arrays easier to deal with. For example, the array initializer syntax didn&#8217;t support arrays that are dynamically allocated or class members arrays:



// Initialize dynamically allocated array by hand todayint* a = new int[3];a[0] = 1;a[1] = 2;a[2] = 99;// Initialize member array by hand todayclass X {  int a[3];public:  X() { a[0] = 1; a[1] = 2; a[2] = 99; }};



In C++0x, the array initialization syntax is uniformly available in these cases too:



// C++0x
int* a = new int[3] { 1, 2, 99 };
class X {  int a[3];public:  X() : a{ 1, 2, 99 } {}};



More concurrency support
Last October, we already voted in a state-of-the-art memory model, atomic operations, and a threading package. That covered the major things we wanted to see in this standard, but a few more were still in progress. Here are the major changes we made this time that relate to concurrency.
Thread-local storage (N2659): To declare a variable which will be instantiated once for each thread, use the thread_local storage class. For example:



class MyClass {  &#8230;private:  thread_local static X tlsX;};


void SomeFunc() {  thread_local static Y tlsY;  &#8230;};



Dynamic initialization and destruction with concurrency (N2660) handles two major cases:

Static and global variables can be concurrently initialized and destroyed if you try to access them on multiple threads before main() begins. If more than one thread could initialize (or use) the variable concurrency, however, it&#8217;s up to you to synchronize access.
Function-local static variables will have their initialization automatically protected; while one thread is initializing the variable, any other threads that enter the function and reach the variable&#8217;s declaration will wait for the initialization to complete before they continue on. Therefore you don&#8217;t need to guard initialization races or initialization-use races, and if the variable is immutable once constructed then you don&#8217;t need to do any synchronization at all to use it safely. If the variable can be written to after construction, you do still need to make sure you synchronize those post-initialization use-use races on the variable.

Thread safety guarantees for the standard library (N2669): The upshot is that the answer to questions like &#8220;what do I need to do to use a vector&lt;T&gt; v or a shared_ptr&lt;U&gt; sp thread-safely?&#8221; is now explicitly &#8220;same as any other object: if you know that an object like v or sp is shared, you must synchronize access to it.&#8221; Only a very few objects need to guarantee internal synchronization; the global allocator is one of those, though, and so it gets that stronger guarantee.
The &#8220;other features&#8221; section below also includes a few smaller concurrency-related items.
More STL algorithms (N2666)
We now have the following new STL algorithms. Some of them fill holes (e.g., &#8220;why isn&#8217;t there a copy_if or a counted version of algorithm X?&#8221;) and others provide handy extensions (e.g., &#8220;why isn&#8217;t there an all_of or any_of?&#8221;).

all_of( first, last, pred )returns true iff all elements in the range satisfy pred
any_of( first, last, pred )returns true iff any element in the range satisfies pred
copy_if( first, last result, pred)the &#8220;why isn&#8217;t this in the standard?&#8221; poster child algorithm
copy_n( first, n result)copy for a known number of n elements
find_if_not( first, last, pred )returns an iterator to the first element that does not satisfy pred
iota( first, last, value )for each element in the range, assigns value and increments value &#8220;as if by ++value&#8221;
is_partitioned( first, last, pred )returns true iff the range is already partitioned by pred; that is, all elements that satisfy pred appear before those that don&#8217;t
none_of( first, last, pred )returns true iff none of the elements in the range satisfies pred
partition_copy( first, last, out_true, out_false, pred )copy the elements that satisfy pred to out_true, the others to out_false
partition_point( first, last, pred)assuming the range is already partitioned by pred (see is_partitioned above), returns an iterator to the first element that doesn&#8217;t satisfy pred
uninitialized_copy_n( first, n, result )uninitialized_copy for a known number of n elements 

Other approved features

N2435 Explicit bool for smart pointers
N2514 Implicit conversion operators for atomics
N2657 Local and unnamed types as template arguments
N2658 Constness of lambda functions
N2667 Reserved namespaces for POSIX
N2670 Minimal support for garbage collection and reachability-based leak detection 
N2661 Time and duration support
N2674 shared_ptr atomic access
N2678 Error handling specification for Chapter 30 (Threads)
N2680 Placement insert for standard containers

Next Meeting
Although we just got back from France, the next meeting of the ISO C++ standards committee is already coming up fast:

September 14-20, 2008: San Francisco, California, USA

The meetings are public, and if you&#8217;re in the area please feel free to drop by.
       </div></summary>
  </entry>

  <entry>
    <title>Effective Concurrency: Choose Concurrenc</title>
    <link href="http://herbsutter.wordpress.com/2008/06/27/effective-concurrency-choose-concurrency-friendly-data-structures/"/>
    <id>http://yoursite/article/?i=7335aebf0bb5aa8fd4bb2a5f7d98046f</id>
    <updated>2008-06-27T21:00:04-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The latest Effective Concurrency column, &#8220;Choose Concurrency-Friendly Data Structures&#8221;, just went live on DDJ&#8217;s site, and also appears in the print magazine. From the article:
What is a high-performance data structure? To answer that question, we&#8217;re used to applying normal considerations like Big-Oh complexity, and memory overhead, locality, and traversal order. All of those apply to both sequential and concurrent software.
But in concurrent code, we need to consider two additional things to help us pick a data structure that is also sufficiently concurrency-friendly:

In parallel code, your performance needs likely include the ability to allow multiple threads to use the data at the same time. If this is (or may become) a high-contention data structure, does it allow for concurrent readers and/or writers in different parts of the data structure at the same time? If the answer is, &#8220;No,&#8221; then you may be designing an inherent bottleneck into your system and be just asking for lock convoys as threads wait, only one being able to use the data structure at a time.
On parallel hardware, you may also care about minimizing the cost of memory synchronization. When one thread updates one part of the data structure, how much memory needs to be moved to make the change visible to another thread? If the answer is, &#8220;More than just the part that has ostensibly changed,&#8221; then again you&#8217;re asking for a potential performance penalty, this time due to cache sloshing as more data has to move from the core that performed the update to the core that is reading the result.

It turns out that both of these answers are directly influenced by whether the data structure allows truly localized updates. &#8230;

I hope you enjoy it.
 
Finally, here are links to previous Effective Concurrency columns (based on the magazine print issue dates):



August 2007
The Pillars of Concurrency


September 2007
How Much Scalability Do You Have or Need?


October 2007
Use Critical Sections (Preferably Locks) to Eliminate Races


November 2007
Apply Critical Sections Consistently


December 2007
Avoid Calling Unknown Code While Inside a Critical Section


January 2007
Use Lock Hierarchies to Avoid Deadlock


February 2008
Break Amdahl&#8217;s Law!


March 2008
Going Superlinear


April 2008
Super Linearity and the Bigger Machine


May 2008
Interrupt Politely


June 2008
Maximize Locality, Minimize Contention


July 2008
Choose Concurrency-Friendly Data Structures



       </div></summary>
  </entry>

  <entry>
    <title>Seneca and Shakespeare on Goals and Oppo</title>
    <link href="http://herbsutter.wordpress.com/2008/06/27/seneca-and-shakespeare-on-goals-and-opportunities/"/>
    <id>http://yoursite/article/?i=e5cfb29a870c6ee3367bf4a51c2d8937</id>
    <updated>2008-06-27T04:30:07-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">From the ancient dramatist Seneca the Younger:
&#8220;Our plans miscarry because they have no aim. When a man does not know what harbor he is making for, no wind is the right wind.&#8221;

And from the Bard, not to be outdone in metaphors of ships and seas:
&#8220;There is a tide in the affairs of men,Which, taken at the flood, leads on to fortune;Omitted, all the voyage of their lifeIs bound in shallows and miseries.We must take the current when it serves,Or lose our ventures.&#8221;

       </div></summary>
  </entry>

  <entry>
    <title>Talking Lambdas with Bill Gates on BBC</title>
    <link href="http://herbsutter.wordpress.com/2008/06/20/talking-lambdas-with-bill-gates-on-bbc/"/>
    <id>http://yoursite/article/?i=ce726d91f816c6608e47d5888fa80003</id>
    <updated>2008-06-22T16:30:04-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">A few weeks ago, the BBC was in town to tape a special interview/documentary on Bill Gates. As part of the footage they got, there&#8217;s a Bill-in-a-technical-review-meeting shot that includes yours truly at a whiteboard presenting an overview-plus-drilldown on C++0x lambda functions. It was a good review; Bill&#8217;s a sharp guy with a broad and deep background and incisive questions.
Here&#8217;s the trailer for the program. If you watch really closely around the 0:47 mark and don&#8217;t blink, you can see a brief flash of me at a whiteboard with code on it in HerbWhiteboardScrawl Sans 60pt, and then Bill gesturing and making a comment (about variable capture consequences, I think).
The BBC documentary &#8220;How a Geek Changed the World&#8221; first aired today in the UK on BBC2; I&#8217;m guessing it will repeat. I don&#8217;t know when it will air in the U.S.
       </div></summary>
  </entry>

  <entry>
    <title>Talking Lambdas With Bill Gates on BBC</title>
    <link href="http://herbsutter.wordpress.com/2008/06/20/talking-lambdas-with-bill-gates-on-bbc/"/>
    <id>http://yoursite/article/?i=3697ee98e290b80f780d2099fff53d94</id>
    <updated>2008-06-20T17:30:04-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">A few weeks ago, the BBC was in town to tape a special interview/documentary on Bill Gates. As part of the footage they got, there&#8217;s a Bill-in-a-technical-review-meeting shot that includes yours truly at a whiteboard presenting an overview-plus-drilldown on C++0x lambda functions. It was a good review; Bill&#8217;s a sharp guy with a broad and deep background and incisive questions.
Here&#8217;s the trailer for the program. If you watch really closely around the 0:47 mark and don&#8217;t blink, you can see a brief flash of me at a whiteboard with code on it in HerbWhiteboardScrawl Sans 60pt, and then Bill gesturing and making a comment (about variable capture consequences, I think).
The BBC documentary &#8220;How a Geek Changed the World&#8221; first aired today in the UK on BBC2; I&#8217;m guessing it will repeat. I don&#8217;t know when it will air in the U.S.
       </div></summary>
  </entry>

  <entry>
    <title>Type Inference vs. Static/Dynamic Typing</title>
    <link href="http://herbsutter.wordpress.com/2008/06/20/type-inference-vs-staticdynamic-typing/"/>
    <id>http://yoursite/article/?i=550e80881e5733bbc128b94afbdeba85</id>
    <updated>2008-06-20T14:30:06-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Jeff Atwood just wrote a nice piece on why type inference is convenient, using a C# sample:
I was absolutely thrilled to be able to refactor this code:
StringBuilder sb = new StringBuilder(256);
UTF8Encoding e = new UTF8Encoding();
MD5CryptoServiceProvider md5 = new MD5CryptoServiceProvider();

Into this:
var sb = new StringBuilder(256);
var e = new UTF8Encoding();
var md5 = new MD5CryptoServiceProvider();

It&#8217;s not dynamic typing, per se; C# is still very much a statically typed language. It&#8217;s more of a compiler trick, a baby step toward a world of Static Typing Where Possible, and Dynamic Typing When Needed. 

It&#8217;s worth making a stronger demarcation among:

type inference, which you can do in any language
static vs. dynamic typing, which is completely orthogonal but all too often confused with inference
strong vs. weak typing, which is mostly orthogonal (e.g., C is statically typed because every variable has a statically known actual type, but also weakly typed because of its casts)

Above, Jeff explicitly separates inference and dynamic-ness. Unfortunately, later on he proceeds to imply that inference is a small step toward dynamic typing, which is stylistically true in principle but might mislead some readers into thinking inference has something to do with dynamic-ness, which it doesn&#8217;t.
Type Inference
Many languages, including C# (as shown above) and the next C++ standard (C++0x, shown below), provide type inference. C++0x does it via the repurposed auto keyword. For example, say you have an object m of type map&lt;int,list&lt;string&gt;&gt;, and you want to create an iterator to it:



map&lt;int,list&lt;string&gt;&gt;::iterator i = m.begin();
// type is required in today&#8217;s C++, allowed in C++0x


auto i = m.begin();
// type can be inferred in C++0x



How many times have you said to your compiler, &#8220;Compiler, you know the type already, why are you making me repeat it?!&#8221; Even the IDE can tell you what the type is when you hover over an expression.
Well, in C++0x you won&#8217;t have to any more, which is often niftily convenient. This gets increasingly important as we don&#8217;t want to, or can&#8217;t, write out the type ourselves, because we have:

types with more complicated names
types without names (or hard-to-find names)
types held most conveniently via an indirection

In particular, consider that C++0x lambda functions generate a function object whose type you generally can&#8217;t spell, so if you want to hold that function object and don&#8217;t have auto then you generally have to use an indirection:



function&lt;void(void)&gt; f = [] { DoSomething(); };auto f = [] { DoSomething(); };
// hold via a wrapper &#8212; requires indirection// infer the type and bind directly



Note that the last line above is more efficient than the C equivalent using a pointer to function, because C++ lets you inline everything. For more on this, see Item 46 in Scott Meyers&#8217; Effective STL on why it&#8217;s preferable to use function objects rather than functions, because (counterintuitively) they&#8217;re more efficient.
Now, though there&#8217;s no question auto and var are great, there are some minor limitations. In particular, you may not want the exact type, but another type that can be converted to:



map&lt;int,list&lt;string&gt;&gt;::const_iterator ci = m.begin();
// ci&#8217;s type is map&lt;int,list&lt;string&gt;&gt;::const_iterator


auto i = m.begin();
// i&#8217;s type is map&lt;int,list&lt;string&gt;&gt;::iterator






Widget* w = new Widget();const Widget* cw = new Widget();WidgetBase* wb = new Widget();shared_ptr&lt;Widget&gt; spw( new Widget() );
// w&#8217;s type is Widget*// cw&#8217;s type is const Widget*// wb&#8217;s type is WidgetBase*// spw&#8217;s type is shared_ptr&lt;Widget&gt;


auto w = new Widget();
// w&#8217;s type is Widget*



So C++0x auto (like C# var) only gets you the most obvious type. Still and all, that does cover a lot of the cases.
The important thing to note in all of the above examples is that, regardless how you spell it, every variable has a clear, unambiguous, well-known and predictable static type. C++0x auto and C# var are purely notational conveniences that save us from having to spell it out in many cases, but the variable still has one fixed and static type.
Static and Dynamic Typing
As Jeff correctly noted in the above-quoted part, this isn&#8217;t dynamic typing, which permits the same variable to actually have different types at different points in its lifetime. Unfortunately, he goes on to say the following that could be mistaken by some readers to imply otherwise:

You might even say implicit variable typing is a gateway drug to more dynamically typed languages.

I know Jeff knows what he&#8217;s talking about because he said it correctly earlier in the same post, but let&#8217;s be clear: Inference doesn&#8217;t have anything to do with dynamic typing. Jeff is just noting that inference just happens to let you declare variables in a style that can be similar to the way you do it all the time in a dynamically typed language. (Before I could post this, I see that Lambda the Ultimate also commented on this confusion. At least one commenter noted that this could be equally viewed as a gateway drug to statically typed languages, because you can get the notational convenience without abandoning static typing.)
Quoting from Bjarne&#8217;s glossary:

dynamic type - the type of an object as determined at run-time; e.g. using dynamic_cast or typeid. Also known as most-derived type.
static type - the type of an object as known to the compiler based on its declaration. See also: dynamic type.

Let&#8217;s revisit an earlier C++ example again, which shows the difference between a variable&#8217;s static type and dynamic type:



WidgetBase* wb = new Widget();if( dynamic_cast&lt;Widget*&gt;( wb ) ) { &#8230; }
// wb&#8217;s static type is WidgetBase*// cast succeeds: wb&#8217;s dynamic type is Widget*



The static type of the variable says what interface it supports, so in this case wb allows you to access only the members of WidgetBase. The dynamic type of the variable is what the object being pointed to right now is.
In dynamically typed languages, however, variables don&#8217;t have a static type and you generally don&#8217;t have to mention the type. In many dynamic languages, you don&#8217;t even have to declare variables. For example:



// Pythonx = 10;x = &#8220;hello, world&#8221;;
// x&#8217;s type is int// x&#8217;s type is str



Boost&#8217;s variant and any
There are two popular ways to get this effect in C++, even though the language remains statically typed. The first is Boost variant:



// C++ using Boostvariant&lt; int, string &gt; x;x = 42;x = &#8220;hello, world&#8221;;x = new Widget();
// say what types are allowed// now x holds an int// now x holds a string// error, not int or string



Unlike a union, a variant can include essentially any kind of type, but you have to say what the legal types are up front. You can even simulate getting overload resolution via boost::apply_visitor, which is checked statically (at compile time). 
The second is Boost any:



// C++ using Boostany x;x = 42;x = &#8220;hello, world&#8221;;x = new Widget();

// now x holds an int// now x holds a string// now x holds a Widget*



Again unlike a union, a variant can include essentially any kind of type. Unlike variant, however, any doesn&#8217;t make (or let) you say what the legal types are up front, which can be good or bad depending how relaxed you want your typing to be. Also, any doesn&#8217;t have a way to simulate overload resolution, and it always requires heap storage for the contained object.
Interestingly, this shows how C++ is well and firmly (and let&#8217;s not forget efficiently) on the path of Static Typing Where Possible, and Dynamic Typing When Needed. 
Use variant when: 

You want an object that holds a value of one of a specific set of types.
You want compile-time checked visitation.
You want the efficiency of stack-based storage where possible scheme (avoiding the overhead of dynamic allocation).
You can live with horrible error messages when you don?t type it exactly right.

Use any when: 

You want the flexibility of having an object that can hold a value of virtually ?any? type.
You want the flexibility of any_cast.
You want the no-throw exception safety guarantee for swap.

       </div></summary>
  </entry>

  <entry>
    <title>Memory Model talk at Gamefest 2008</title>
    <link href="http://herbsutter.wordpress.com/2008/06/10/memory-model-talk-at-gamefest-2008/"/>
    <id>http://yoursite/article/?i=c3dd10e2444f5019c7722ce2c8980894</id>
    <updated>2008-06-11T00:00:15-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">I&#8217;ll be giving a memory model talk at Gamefest in Seattle next month. Here&#8217;s a quick summary:
Memory Models: Foundational Knowledge for Concurrent CodeJuly 22-23, 2008Gamefest 2008Seattle, WA, USA
A memory model defines a contract between the programmer and the execution environment, that trades off:

programmability via stronger guarantees for programmers, vs.
performance via greater flexibility for reordering program memory operations.

The ?execution environment? includes everything from the compiler and optimizer on down to the CPU and cache hardware, and it really wants to help you by reordering your program to make it run faster. You, on the other hand, you want it to not help you excessively in ways that will break the meaning of your code. In this talk, we?ll consider why a memory model is important, how to achieve a reasonable balance, detailed considerations on current and future PC and Xbox platforms, and some best practices for writing solid concurrent code.

       </div></summary>
  </entry>

  <entry>
    <title>Stroustrup  Sutter on C++: The Interview</title>
    <link href="http://herbsutter.wordpress.com/2008/06/10/stroustrup-sutter-on-c-the-interviews/"/>
    <id>http://yoursite/article/?i=8453dcc6c61bb2c875375900200a450d</id>
    <updated>2008-06-11T00:00:14-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">While Bjarne and I were at SD for S&amp;S, we took time out to do an interview together with Ted Neward for InformIT. I just got word that it went live&#8230; here are the links.
On the OnSoftware ? Video (RSS):

OnSoftware - Bjarne Stroustrup &amp; Herb Sutter on the Future of C++ - Part 1
OnSoftware - Bjarne Stroustrup &amp; Herb Sutter on the Future of C++ - Part 2

On the OnSoftware ? Audio (RSS):

OnSoftware - Bjarne Stroustrup&amp;Herb Sutter on the Future of C++ - Part 1
OnSoftware - Bjarne Stroustrup&amp;Herb Sutter on the Future of C++ - Part 2

Enjoy!
       </div></summary>
  </entry>

  <entry>
    <title>Effective Concurrency: Maximize Locality</title>
    <link href="http://herbsutter.wordpress.com/2008/05/23/effective-concurrency-maximize-locality-minimize-contention/"/>
    <id>http://yoursite/article/?i=a748b946eac3475f2d9c48b401613ae1</id>
    <updated>2008-05-23T16:00:15-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The latest Effective Concurrency column, &#8220;Maximize Locality, Minimize Contention&#8221;, just went live on DDJ&#8217;s site, and also appears in the print magazine. From the article:
Want to kill your parallel application&#8217;s scalability? Easy: Just add a dash of contention.
Locality is no longer just about fitting well into cache and RAM, but also about avoiding scalability busters by keeping tightly coupled data physically close together and separately used data far, far apart. &#8230;

I hope you enjoy it.
 
Finally, here are links to previous Effective Concurrency columns (based on the dates they hit the web, not the magazine print issue dates):



July 2007
The Pillars of Concurrency


August 2007
How Much Scalability Do You Have or Need?


September 2007
Use Critical Sections (Preferably Locks) to Eliminate Races


October 2007
Apply Critical Sections Consistently


November 2007
Avoid Calling Unknown Code While Inside a Critical Section


December 2007
Use Lock Hierarchies to Avoid Deadlock


January 2008
Break Amdahl&#8217;s Law!


February 2008
Going Superlinear


March 2008
Super Linearity and the Bigger Machine


April 2008
Interrupt Politely


May 2008
Maximize Locality, Minimize Contention



       </div></summary>
  </entry>

  <entry>
    <title>Part 2 of concurrency interview with Dev</title>
    <link href="http://herbsutter.wordpress.com/2008/05/08/part-2-of-concurrency-interview-with-devx/"/>
    <id>http://yoursite/article/?i=7ce243888b1c4148003792ac911e9421</id>
    <updated>2008-05-08T21:00:07-07:00</updated>
    <author>
      <name>http://herbsutter.wordpress.com/</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Part 2 of DevX&#8217;s interview with me about concurrency just went live on the web. From the article&#8217;s blurb:
What does the future hold for concurrency? What will happen to the tools and techniques around concurrent programming? In part two of our series, concurrency guru Herb Sutter talks about these issues and what developers need to be reading to understand concurrency. 
&#8230; In this final installment he looks into his crystal ball with an eye towards the future and gives developers hints for the resources they need to be better concurrent programmers.

This part touches on a variety of topics, from right-now items like delivering parallelism internally inside libraries to shield the programmer from knowing about concurrency and where to look for further reading, to future topics like transactional memory and upcoming homogeneous vs. heterogeneous manycore CPUs. I hope you enjoy it.
(March&#8217;s part 1 is here.)
       </div></summary>
  </entry>

  <entry>
    <title>Where to find the state of ISO C++ evolu</title>
    <link href="http://herbsutter.wordpress.com/2008/04/23/where-to-find-the-state-of-iso-c-evolution/"/>
    <id>http://yoursite/article/?i=0f6ebcf589fe3a86201cadecddb89729</id>
    <updated>2008-04-23T10:09:00-07:00</updated>
    <author>
      <name>e465a56a7dfef31970a7a57ce5685dbd</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">After each ISO C++ meeting, I post a trip report update to my blog summarizing what&#8217;s new as of that meeting with a drill-down into some highlights. But wouldn&#8217;t it be handy to have an up-to-date summary scorecard with a snapshot of all proposals&#8217; status to date? Indeed it would, and so today someone asked me in email:
I&#8217;m a software developer interested in forthcoming C++ standard. Are there any resources on the web where can I find list of already accepted proposals as of the last meeting in Bellevue? I know that I can read the draft but I would like to have all new features in a list form.

Answer: Yes, thanks to the gracious volunteer efforts of Alisdair Meredith. Alisdair maintains the ?State of C++ Evolution? paper, and posts updated versions before and after each ISO committee meeting. You can find the current one here:

N2565, 2008-03-07: State of C++ Evolution (Post-Bellevue 2008 Mailing)

For updates, just watch the committee papers pages where new batches of papers get posted every two or three months, including new versions of the evolution status paper and new updated working drafts of the next ISO C++ standard (maintained by our hardworking, and amazingly tireless, project editor Pete Becker).
Thanks, Alisdair and Pete!
Notes
1. Yes, Pete&#8217;s car has wheels. That&#8217;s not what I meant.
       </div></summary>
  </entry>

  <entry>
    <title>Quad-core a waste of electricity?</title>
    <link href="http://herbsutter.wordpress.com/2008/04/18/quad-core-a-waste-of-electricity/"/>
    <id>http://yoursite/article/?i=2699b61f46b9ce0412ffdcb02d996745</id>
    <updated>2008-04-18T11:10:52-07:00</updated>
    <author>
      <name>e465a56a7dfef31970a7a57ce5685dbd</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Jeff Atwood wrote:
In my opinion, quad-core CPUs are still a waste of electricity unless you?re putting them in a server. Four cores on the desktop is great for bragging rights and mathematical superiority (yep, 4 &gt; 2), but those four cores provide almost no benchmarkable improvement in the type of applications most people use. Including software development tools.
Really? You must not be using the right tools. :-) For example, here are three I?m familiar with:



 Visual C++ 2008?s /MP flag tells the compiler to compile files in the same project in parallel. I typically get linear speedups on the compile phase. The link phase is still sequential, but on most projects compilation dominates.


Since Visual Studio 2005 we?ve supported parallel project builds in Batch Build mode, where you can build multiple subprojects in parallel (e.g., compile your release and debug builds in parallel), though that feature didn?t let you compile multiple files in the same project in parallel. (As I?ve blogged about before, Visual C++ 2005 actually already shipped with the /MP feature, but it was undocumented.)


 Excel 2007 does parallel recalculation. Assuming the spreadsheet is large and doesn?t just contain sequential dependencies between cells, it usually scales linearly up to at least 8 cores (the most I heard that was tested before shipping). I&#8217;m told that customers who are working on big financial spreadsheets love it.


&#8230; And need I mention games? (This is just a snarky comment&#8230; Jeff already correctly noted that &#8220;rendering, encoding, or scientific applications&#8221; are often scalable today.)



And of course, even if you&#8217;re having a terrible day and not a single one of your applications can use more than one core, you can still see real improvement on CPU-intensive multi-application workloads on a multicore machine today, such as by being able to run other foreground applications at full speed while encoding a movie in the background.
Granted, as I?ve said before, we do need to see examples of manycore (e.g., &gt;10 cores) exploiting mainstream applications (e.g., something your dad might use). But it?s overreaching to claim that there are no multicore (e.g., &lt;10 cores) exploiting applications at all, not even development tools. We may not yet have achieved the mainstream manycore killer app, but it isn&#8217;t like we have nothing to show at all. We have started out on the road that will take us there.
       </div></summary>
  </entry>

  <entry>
    <title>Usability: Watch out for those non-error</title>
    <link href="http://herbsutter.wordpress.com/2008/04/11/usability-watch-out-for-those-non-errors-that-start-with-er/"/>
    <id>http://yoursite/article/?i=e4fee476efa8302d829d8149b54babe5</id>
    <updated>2008-04-11T08:15:26-07:00</updated>
    <author>
      <name>e465a56a7dfef31970a7a57ce5685dbd</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Today I had a nice lesson in transaction codes. I did a happy little online transaction, and then the confirmation screen came up with what at first glance looked like an error. It startled me, until I read more closely:
Thank you. Your transaction has been placed and received by SuperMondoCorp.
Transaction Confirmation Number: ER6661234567
&#8220;Yikes!&#8221; thought I to myself, thought I. Then, &#8220;oh, the bolded confirmation number just starts with ER which only looks like ERR.&#8221; (And yes, the rest of the number did start with 666. I only altered the other numbers.)
I realize you can&#8217;t anticipate everything, but it is a reminder about usability. If the thing you draw the customer&#8217;s eye to on a confirmation screen can start with what looks like a negative confirmation, it&#8217;s not the greatest thing.
       </div></summary>
  </entry>

  <entry>
    <title>Effective Concurrency: Interrupt Politel</title>
    <link href="http://herbsutter.wordpress.com/2008/04/10/effective-concurrency-interrupt-politely/"/>
    <id>http://yoursite/article/?i=1857f2abf63c798bf9fcb1e167fcbbc0</id>
    <updated>2008-04-10T04:53:38-07:00</updated>
    <author>
      <name>e465a56a7dfef31970a7a57ce5685dbd</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The latest Effective Concurrency column, &#8220;Interrupt Politely&#8221;, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:
 Violence isn&#8217;t the answer.
We want to be able to stop a running thread or task when we discover that we no longer need or want to finish it. As we saw in the last two columns, in a simple parallel search we can stop other workers once one finds a match, and when speculatively running two alternative algorithms to compute the same result we can stop the longer-running one once the first finds a result. [1,2] Stopping threads or tasks lets us reclaim their resources, including locks, and apply them to other work.
But how do you stop a thread or task you longer need or want? Table 1 summarizes the four main ways, and how they are supported on several major platforms. Let&#8217;s consider them in turn. &#8230;
I hope you enjoy it.
 
Finally, here are links to previous Effective Concurrency columns (based on the dates they hit the web, not the magazine print issue dates):



July 2007
The Pillars of Concurrency


August 2007
How Much Scalability Do You Have or Need?


September 2007
Use Critical Sections (Preferably Locks) to Eliminate Races


October 2007
Apply Critical Sections Consistently


November 2007
Avoid Calling Unknown Code While Inside a Critical Section


December 2007
Use Lock Hierarchies to Avoid Deadlock


January 2008
Break Amdahl&#8217;s Law!


February 2008
Going Superlinear


March 2008
Super Linearity and the Bigger Machine


April 2008
Interrupt Politely



       </div></summary>
  </entry>

  <entry>
    <title>Cringe not: Vectors are guaranteed to be</title>
    <link href="http://herbsutter.wordpress.com/2008/04/07/cringe-not-vectors-are-guaranteed-to-be-contiguous/"/>
    <id>http://yoursite/article/?i=aa16bfbe0ab803357fa570fec460b2ed</id>
    <updated>2008-04-07T17:29:50-07:00</updated>
    <author>
      <name>e465a56a7dfef31970a7a57ce5685dbd</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Andy Koenig is the expert&#8217;s expert, and I rarely disagree with him. And, well, when I do disagree I&#8217;m invariably wrong&#8230; but there&#8217;s a first time for everything, so I&#8217;ll take my chances one more time.
I completely agree with the overall sentiment of Andy&#8217;s blog entry today:
I spend a fair amount of time reading (and sometimes responding to) questions in the C++ newsgroups. Every once in a while, someone asks a question that makes me cringe.
What makes a question cringe-worthy?
Usually it is a question that implies that the person asking it is trying to do something inappropriate.
&#8230;
Asking how to violate programming-language abstractions is similar: If you have to ask, you probably shouldn&#8217;t be doing it.
Amen! Bravo! Absolutely correct. Great stuff. Except that the example in question isn&#8217;t violating an abstraction:
For example, I just saw one such question: Are the elements of a std::vector contiguous? Here is why that question made me cringe.
Every C++ container is part of an abstraction that includes several companion iterators. The normal way of accessing a container&#8217;s elements is through such an iterator.
I can think of only one reason why one should care whether the elements of a vector are in continuous memory, and that is if you intend to use pointers, rather than iterators, to access those elements. Doing so, of course, violates the abstraction.
There is nothing wrong per se with violating abstractions: As Robert Dewar told me more years ago than I care to remember, some programs are poorly designed on purpose. However, there is something wrong with violating abstractions when you know so little of the data structures used to implement those abstractions that you have to ask strangers on Usenet about your proposed violation. To put it more bluntly: If you have to ask whether vector elements are contiguous, you probably should not be trying to make use of that knowledge.
The reason this analysis isn&#8217;t quite fair is that contiguity is in fact part of the vector abstraction. It&#8217;s so important, in fact, that when it was discovered that the C++98 standard didn&#8217;t completely guarantee contiguity, the C++03 standard was amended to explicitly add the guarantee.
Why is it so important that vectors be contiguous? Because that&#8217;s what you need to guarantee that a vector is layout-compatible with a C array, and therefore we have no reason not to use vector as a superior and type-safe alternative to arrays even when we need to exchange data with C code. So vector is our gateway to other languages and most operating systems features, whose lingua franca is the venerable C array.
And it&#8217;s not just vector: The TR1 and C++0x std::array, which implements fixed-size arrays, is also guaranteed to be contiguous for the same reasons. (std::array is available in Boost and, ahem, the VC++ TR1 implementation we shipped today.)
So why do people continually ask whether the elements of a std::vector (or std::array) are stored contiguously? The most likely reason is that they want to know if they can cough up pointers to the internals to share the data, either to read or to write, with other code that deals in C arrays. That&#8217;s a valid use, and one important enough to guarantee in the standard.
       </div></summary>
  </entry>

  <entry>
    <title>Visual C++ 2008 Feature Pack now availab</title>
    <link href="http://herbsutter.wordpress.com/2008/04/07/visual-c-2008-feature-pack-now-available/"/>
    <id>http://yoursite/article/?i=c4e636b75fff6790542be72a31540d0b</id>
    <updated>2008-04-07T16:58:49-07:00</updated>
    <author>
      <name>e465a56a7dfef31970a7a57ce5685dbd</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Back in November, I reported that we&#8217;d be shipping Visual C++ 2008 that month (we did!) and that we&#8217;d soon thereafter be doing the &#8220;agile thing&#8221; and shipping a major update mere months later, instead of waiting two years between releases per our prior tradition. I wrote:
The update is expected to be available in beta form in January 2008, and to ship in the first half of 2008. Enjoy!
Well, it&#8217;s official: It&#8217;s available. Enjoy! Besides major updates to MFC for the latest Office/VS/Vista look-and-feel to support first-class native code development, it also includes most of TR1 (everything except C99 compatibility, and the special math functions that didn&#8217;t make it into C++0x):

TR1 (?Technical Report 1?) is a set of proposed additions to the C++0x standard.  Our implementation of TR1 contains a number of important features such as smart pointers, regular expression parsing, containers (tuple, array, unordered set, etc) and sophisticated random number generators.
More information on TR1 can be found at the sites below:
TR1 documentation
Channel 9: Digging into TR1
TR1 slide decks (recommended)

Enjoy, everyone - and thanks, team!
Notes
1. This feature pack requires Visual C++ 2008 Standard or above. The only VC08 edition it doesn&#8217;t work with is Express; we&#8217;ll support Express in a future release.
2. When I wrote that it would be available &#8220;in the first half of 2008,&#8221; a number of people seemed to automatically interpret that as code for &#8220;maybe around June 31.&#8221; We&#8217;re not always that bad at shipping, fortunately. :-)
3. Yes, I know that June has 30 days.
       </div></summary>
  </entry>

  <entry>
    <title>Trip Report: February/March 2008 ISO C++</title>
    <link href="http://herbsutter.wordpress.com/2008/03/29/trip-report-februarymarch-2008-iso-c-standards-meeting/"/>
    <id>http://yoursite/article/?i=26422664a523a4c3e41584340095c48a</id>
    <updated>1969-12-31T16:00:00-08:00</updated>
    <author>
      <name>e465a56a7dfef31970a7a57ce5685dbd</name>
      <email>AUTHOR_EMAIL@email.com</email>
    </author>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">[Updated Apr 3 to note automatic deduction of return type.]
The ISO C++ committee met in Bellevue, WA, USA on February 24 to March 1, 2008. Here?s a quick summary of what we did (with links to the relevant papers to read for more details), and information about upcoming meetings.
Lambda functions and closures (N2550)
For me, easily the biggest news of the meeting was that we voted lambda functions and closures into C++0x. I think this will make STL algorithms an order of magnitude more usable, and it will be a great boon to concurrent code where it&#8217;s important to be able to conveniently pass around a piece of code like an object, to be invoked wherever the program sees fit (e.g., on a worker thread).
C++ has always supported this via function objects, and lambdas/closures are merely syntactic sugar for writing function object. But, though &#8220;merely&#8221; a convenience, they are an incredibly powerful convenience for many reasons, including that they can be written right at the point of use instead of somewhere far away.
Example: Write collection to console
For example, let&#8217;s say you want to write each of a collection of Widgets to the console.
// Writing a collection to cout, in today&#8217;s C++, option 1:
for( vector&lt;Widget&gt;::iterator i = w.begin(); i != w.end(); ++i )
  cout &lt;&lt; *i &lt;&lt; &#8221; &#8220;;
Or we can leverage that C++ already has a special-purpose ostream_iterator type that does what we want:
// Writing a collection to cout, in today&#8217;s C++, option 2:
copy( w.begin(), w.end(),
          ostream_iterator&lt;const Widget&gt;( cout, &#8221; &#8221; ) );
In C++0x, just use a lambda that writes the right function object on the fly:
// Writing a collection to cout, in C++0x:
for_each( w.begin(), w.end(),
                []( const Widget&amp; w ) { cout &lt;&lt; w &lt;&lt; &#8221; &#8220;; } );
(Usability note: The lambda version was the only one I wrote correctly the first time as I tried these examples on compilers to check them. &#8216;Nuff said. &lt;tease type=&#8221;shameless&#8221;&gt; Yes, that means I tried it on a compiler. No, I&#8217;m not making any product feature announcements about VC++ version 10. At least not right now. &lt;/tease&gt;)
Example: Find element with Weight() &gt; 100
For another example, let&#8217;s say you want to find an element of a collection of Widgets whose weight is greater than 100. Here&#8217;s what you might write today:
// Calling find_if using a functor, in today&#8217;s C++:
// outside the function, at namespace scope
class GreaterThan {
  int weight;
public:
  GreaterThan( int weight_ )
    : weight(weight_) { }
  bool operator()( const Widget&amp; w ) {
    return w.Weight() &gt; weight;
  }
};
// at point of use
find_if( w.begin(), w.end(), GreaterThan(100) );
At this point some people will point out that (a) we have C++98 standard binder helpers like bind2nd or (b) that we have Boost&#8217;s bind and lambda libraries. They don&#8217;t really help much here, at least not if you&#8217;re interested in having the code be readable and maintainable. If you doubt, try and see.
In C++0x, you can just write:
// Calling find_if using a lambda, in C++0x:
find_if( w.begin(), w.end(),
            []( Widget&amp; w ) { return w.Weight() &gt; 100; } );
Ah. Much better.
Most algorithms are loops&#8230; hmm&#8230;
In fact, every loop-like algorithm is now usable as a loop. Quick examples using std::for_each and std::transform:
for_each( v.begin(), v.end(), []( Widget&amp; w )
{
  &#8230;
  &#8230; use or modify w &#8230;
  &#8230;
} );
transform( v.begin(), v.end(), output.begin(), []( Widget&amp; w )
{
  &#8230;
  return SomeResultCalculatedFrom( w );
} );
Hmm. Who knows: As C++0x lambdas start to be supported in upcoming compilers, we may start getting more used to seeing &#8220;});&#8221; as the end of a loop body.
Concurrency teaser
Finally, want to pass a piece of code to be executed on a thread pool without tediously having to define a functor class out at namespace scope? Do it directly:
// Passing work to a thread pool, in C++0x:
mypool.run( [] { cout &lt;&lt; &#8220;Hello there (from the pool)&#8221;; } );
Gnarly.
Other approved features

N2535 Namespace associations (inline namespace)
N2540 Inheriting constructors
N2541 New function declarator syntax
N2543 STL singly linked lists (forward_list)
N2544 Unrestricted unions
N2546 Removal of auto as a storage-class specifier
N2551 Variadic template versions of std::m