<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:media="http://search.yahoo.com/mrss"
	>

<channel>
	<title>Sutter's Mill</title>
	<atom:link href="http://herbsutter.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://herbsutter.wordpress.com</link>
	<description>Herb Sutter on software, hardware, and concurrency</description>
	<pubDate>Fri, 09 May 2008 02:43:21 +0000</pubDate>
	<generator>http://wordpress.org/?v=MU</generator>
	<language>en</language>
			<item>
		<title>Part 2 of concurrency interview with DevX</title>
		<link>http://herbsutter.wordpress.com/2008/05/08/part-2-of-concurrency-interview-with-devx/</link>
		<comments>http://herbsutter.wordpress.com/2008/05/08/part-2-of-concurrency-interview-with-devx/#comments</comments>
		<pubDate>Fri, 09 May 2008 02:43:21 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Concurrency]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/05/08/part-2-of-concurrency-interview-with-devx/</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.devx.com/go-parallel/Article/37839">Part 2</a> of DevX&#8217;s interview with me about concurrency just went live on the web. From the article&#8217;s blurb:</p>
<blockquote><p>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.&nbsp;
<p>&#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.</p>
</blockquote>
<p>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.</p>
<p>(March&#8217;s <a href="http://www.devx.com/go-parallel/Article/37573">part 1 is here</a>.)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/88/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/88/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/88/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/88/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/88/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=88&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/05/08/part-2-of-concurrency-interview-with-devx/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Where to find the state of ISO C++ evolution</title>
		<link>http://herbsutter.wordpress.com/2008/04/23/where-to-find-the-state-of-iso-c-evolution/</link>
		<comments>http://herbsutter.wordpress.com/2008/04/23/where-to-find-the-state-of-iso-c-evolution/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 17:09:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/04/23/where-to-find-the-state-of-iso-c-evolution/</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>After each ISO C++ meeting, I post a <a href="http://herbsutter.wordpress.com/2008/03/29/trip-report-februarymarch-2008-iso-c-standards-meeting/">trip report</a> 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:</p>
<blockquote><p>I&#8217;m a software developer interested in forthcoming C++ standard. Are there any resources on the web where can I find <br />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.</p>
</blockquote>
<p>Answer: Yes, thanks to the gracious volunteer efforts of <a href="http://www.ddj.com/cpp/202801210">Alisdair Meredith</a>. 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:
<ul>
<li><a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2565.html">N2565, 2008-03-07: State of C++ Evolution (Post-Bellevue 2008 Mailing)</a></li>
</ul>
<p>For updates, just watch the <a href="http://www.open-std.org/JTC1/SC22/WG21/docs/papers/">committee papers pages</a> 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 <a href="http://www.petebecker.com/">Pete Becker</a>).
<p>Thanks, Alisdair and Pete!<br />
<h4>Notes</h4>
<p>1. Yes, Pete&#8217;s car has wheels. That&#8217;s not what I meant.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/87/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/87/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=87&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/04/23/where-to-find-the-state-of-iso-c-evolution/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Quad-core a &#34;waste of electricity&#34;?</title>
		<link>http://herbsutter.wordpress.com/2008/04/18/quad-core-a-waste-of-electricity/</link>
		<comments>http://herbsutter.wordpress.com/2008/04/18/quad-core-a-waste-of-electricity/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 18:10:52 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[Concurrency]]></category>

		<category><![CDATA[Hardware]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/?p=86</guid>
		<description><![CDATA[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 &#62; 2), but those four cores provide almost no benchmarkable improvement in the type of applications most people use. Including [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Jeff Atwood <a href="http://www.codinghorror.com/blog/archives/001102.html">wrote</a>:</p>
<blockquote><p>In my opinion, quad-core CPUs are still a <a href="http://www.codinghorror.com/blog/archives/000942.html">waste of electricity</a> 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 <a href="http://www.codinghorror.com/blog/archives/000655.html">provide almost no benchmarkable improvement</a> in the type of applications most people use. Including software development tools.</p></blockquote>
<p>Really? You must not be using the right tools. :-) For example, here are three I’m familiar with:</p>
<table border="0" cellspacing="10" cellpadding="10" width="507">
<tbody>
<tr>
<td width="485" valign="top"><a href="http://msdn2.microsoft.com/en-us/library/bb385193.aspx"><img style="border-width:0;margin:5px 0 0 10px;" src="http://herbsutter.files.wordpress.com/2008/04/image.png?w=240&h=68" border="0" alt="image" width="240" height="68" align="right" /></a> <strong>Visual C++ 2008</strong>’s <a href="http://msdn2.microsoft.com/en-us/library/bb385193.aspx">/MP flag</a> 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.</td>
</tr>
<tr>
<td width="485" valign="top"><a href="http://msdn2.microsoft.com/en-us/library/9h3z1a69.aspx"><img style="margin:5px 10px 5px 0;" src="http://herbsutter.files.wordpress.com/2008/04/image1.png?w=240&h=43" border="0" alt="image" width="240" height="43" align="left" /></a>Since <strong>Visual Studio 2005</strong> we’ve supported <a href="http://msdn2.microsoft.com/en-us/library/9h3z1a69.aspx">parallel project builds</a> 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 <a href="http://herbsutter.wordpress.com/2007/08/08/visual-c-qa/">before</a>, Visual C++ 2005 actually already shipped with the /MP feature, but it was undocumented.)</td>
</tr>
<tr>
<td width="485" valign="top"><a href="http://msdn2.microsoft.com/en-us/library/bb687899.aspx"><img style="border-width:0;margin:5px 0 0 10px;" src="http://herbsutter.files.wordpress.com/2008/04/image2.png?w=240&h=73" border="0" alt="image" width="240" height="73" align="right" /></a> <strong>Excel 2007</strong> does <a href="http://msdn2.microsoft.com/en-us/library/bb687899.aspx">parallel recalculation</a>. 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.</td>
</tr>
<tr>
<td width="485"><a href="http://herbsutter.files.wordpress.com/2008/04/image3.png"><img style="border-width:0;margin:5px 20px 0 0;" src="http://herbsutter.files.wordpress.com/2008/04/image-thumb.png?w=240&h=71" border="0" alt="image" width="240" height="71" align="left" /></a>&#8230; <a href="http://msdn2.microsoft.com/en-us/library/bb204834(VS.85).aspx">And</a> <a href="http://arstechnica.com/articles/paedia/cpu/valve-multicore.ars/2">need I</a> <a href="http://www.anandtech.com/tradeshows/showdoc.aspx?i=2868&amp;p=5">mention</a> <a href="http://www.anandtech.com/tradeshows/showdoc.aspx?i=2868&amp;p=7">games</a>? (This is just a snarky comment&#8230; Jeff already correctly <a href="http://www.codinghorror.com/blog/archives/000942.html">noted</a> that &#8220;rendering, encoding, or scientific applications&#8221; are often scalable today.)</td>
</tr>
</tbody>
</table>
<p>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.</p>
<p>Granted, as I’ve <a href="http://herbsutter.wordpress.com/2008/02/01/how-parallelism-demos-are-useful/">said before</a>, we do need to see examples of <em>manycore</em> (e.g., &gt;10 cores) exploiting <em>mainstream</em> 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.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/86/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/86/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/86/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/86/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/86/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=86&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/04/18/quad-core-a-waste-of-electricity/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>

		<media:content url="http://herbsutter.files.wordpress.com/2008/04/image.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://herbsutter.files.wordpress.com/2008/04/image1.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://herbsutter.files.wordpress.com/2008/04/image2.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://herbsutter.files.wordpress.com/2008/04/image-thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Usability: Watch out for those non-errors that start with &#8220;ER&#8221;</title>
		<link>http://herbsutter.wordpress.com/2008/04/11/usability-watch-out-for-those-non-errors-that-start-with-er/</link>
		<comments>http://herbsutter.wordpress.com/2008/04/11/usability-watch-out-for-those-non-errors-that-start-with-er/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 15:15:26 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Friday Thoughts]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/?p=74</guid>
		<description><![CDATA[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, [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>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:</p>
<blockquote><p><span class="ofAltBackgroundColorD9 ofAlt0Border">Thank you. Your transaction has been placed and received by SuperMondoCorp.</span></p>
<p>Transaction Confirmation Number: <strong>ER6661234567</strong></p></blockquote>
<p>&#8220;Yikes!&#8221; thought I to myself, thought I. Then, &#8220;oh, the bolded confirmation number just starts with <strong>ER</strong> which only looks like <strong>ERR</strong>.&#8221; (And yes, the rest of the number did start with 666. I only altered the other numbers.)</p>
<p>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.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/74/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/74/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/74/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/74/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/74/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=74&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/04/11/usability-watch-out-for-those-non-errors-that-start-with-er/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Effective Concurrency: Interrupt Politely</title>
		<link>http://herbsutter.wordpress.com/2008/04/10/effective-concurrency-interrupt-politely/</link>
		<comments>http://herbsutter.wordpress.com/2008/04/10/effective-concurrency-interrupt-politely/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 11:53:38 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[Concurrency]]></category>

		<category><![CDATA[Software Development]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/?p=79</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div>The latest <strong>Effective Concurrency</strong> column, <a href="http://ddj.com/architect/207100682"><strong><span style="color:#0066a7;">&#8220;Interrupt Politely&#8221;</span></strong></a>, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:</div>
<blockquote><p><em><a href="http://q6z56g.bay.livefilestore.com/y1pkBWHZvSH-12PpsY9aPA5IjFpw4o6VI-jm9IDTuH_MWa_QNaN6pLoVAXwVLjm1-NvCA88-7VhrZAlisJxNo39zw?PARTNER=WRITER"><img style="border-width:0;" src="http://by2.storage.msn.com/y1pchDoYPr1r3sBcvHYTQBvkNy8mavd0_fggOJ_7-5BKv-dk-Gxgmg2FUgnzafXQDewfXpwGvmbG4YG1zuyzMqaUqJGcuyw8akH?PARTNER=WRITER" border="0" alt="ec10-tbl1" width="240" height="151" align="right" /></a> Violence isn&#8217;t the answer.</em></p>
<p>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.</p>
<p>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;</p></blockquote>
<div>I hope you enjoy it.</div>
<div> </div>
<div>Finally, here are links to previous Effective Concurrency columns (based on the dates they hit the web, not the magazine print issue dates):</div>
<table border="0" cellspacing="5" cellpadding="5" width="555">
<tbody>
<tr>
<td width="114" valign="top">July 2007</td>
<td width="422" valign="top"><a href="http://www.ddj.com/hpc-high-performance-computing/200001985"><span style="color:#0066a7;">The Pillars of Concurrency</span></a></td>
</tr>
<tr>
<td width="114" valign="top">August 2007</td>
<td width="422" valign="top"><a href="http://www.ddj.com/hpc-high-performance-computing/201202924"><span style="color:#0066a7;">How Much Scalability Do You Have or Need?</span></a></td>
</tr>
<tr>
<td width="114" valign="top">September 2007</td>
<td width="422" valign="top"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://ddj.com/cpp/201804238"><span style="color:#0066a7;">Use Critical Sections (Preferably Locks) to Eliminate Races</span></a></td>
</tr>
<tr>
<td width="114" valign="top">October 2007</td>
<td width="422" valign="top"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://www.ddj.com/hpc-high-performance-computing/202401098"><span style="color:#0066a7;">Apply Critical Sections Consistently</span></a></td>
</tr>
<tr>
<td width="114" valign="top">November 2007</td>
<td width="422" valign="top"><a href="http://herbsutter.spaces.live.com/blog/cns!2D4327CC297151BB!342.entry"></a><a title="Avoid Calling Unknown Code While Inside a Critical Section" href="http://ddj.com/architect/202802983"><span style="color:#0066a7;">Avoid Calling Unknown Code While Inside a Critical Section</span></a></td>
</tr>
<tr>
<td width="114" valign="top">December 2007</td>
<td width="422" valign="top"><a href="http://www.ddj.com/hpc-high-performance-computing/204801163"><span style="color:#0066a7;">Use Lock Hierarchies to Avoid Deadlock</span></a></td>
</tr>
<tr>
<td width="114" valign="top">January 2008</td>
<td width="422" valign="top"><a href="http://www.ddj.com/cpp/205900309"><span style="color:#0066a7;">Break Amdahl&#8217;s Law!</span></a></td>
</tr>
<tr>
<td width="114" valign="top">February 2008</td>
<td width="422" valign="top"><a href="http://www.ddj.com/hpc-high-performance-computing/206100542"><span style="color:#0066a7;">Going Superlinear</span></a></td>
</tr>
<tr>
<td width="114" valign="top">March 2008</td>
<td width="422" valign="top"><a href="http://www.ddj.com/hpc-high-performance-computing/206903306"><span style="color:#0066a7;">Super Linearity and the Bigger Machine</span></a></td>
</tr>
<tr>
<td width="114" valign="top">April 2008</td>
<td width="422" valign="top"><a href="http://ddj.com/architect/207100682"><span style="color:#0066a7;">Interrupt Politely</span></a></td>
</tr>
</tbody>
</table>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/79/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/79/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/79/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/79/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/79/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=79&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/04/10/effective-concurrency-interrupt-politely/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>

		<media:content url="http://by2.storage.msn.com/y1pchDoYPr1r3sBcvHYTQBvkNy8mavd0_fggOJ_7-5BKv-dk-Gxgmg2FUgnzafXQDewfXpwGvmbG4YG1zuyzMqaUqJGcuyw8akH?PARTNER=WRITER" medium="image">
			<media:title type="html">ec10-tbl1</media:title>
		</media:content>
	</item>
		<item>
		<title>Cringe not: Vectors are guaranteed to be contiguous</title>
		<link>http://herbsutter.wordpress.com/2008/04/07/cringe-not-vectors-are-guaranteed-to-be-contiguous/</link>
		<comments>http://herbsutter.wordpress.com/2008/04/07/cringe-not-vectors-are-guaranteed-to-be-contiguous/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 00:29:50 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/?p=76</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.acceleratedcpp.com/authors/koenig/">Andy Koenig</a> 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.</p>
<p>I completely agree with the overall sentiment of <a href="http://dobbscodetalk.com/index.php?option=com_content&amp;task=view&amp;id=285&amp;Itemid=">Andy&#8217;s blog entry today</a>:</p>
<blockquote><p>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.</p>
<p>What makes a question cringe-worthy?</p>
<p>Usually it is a question that implies that the person asking it is trying to do something inappropriate.</p>
<p>&#8230;</p>
<p>Asking how to violate programming-language abstractions is similar: If you have to ask, you probably shouldn&#8217;t be doing it.</p></blockquote>
<p>Amen! Bravo! Absolutely correct. Great stuff. Except that the example in question isn&#8217;t violating an abstraction:</p>
<blockquote><p>For example, I just saw one such question: <em>Are the elements of a </em>std::vector<em> contiguous?</em> Here is why that question made me cringe.</p>
<p>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.</p>
<p>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.</p>
<p>There is nothing wrong <em>per </em>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 <em>is</em> 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.</p></blockquote>
<p>The reason this analysis isn&#8217;t quite fair is that contiguity <em>is</em> 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.</p>
<p>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.</p>
<p>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 <a href="http://www.boost.org">Boost</a> and, ahem, the VC++ TR1 implementation <a href="http://herbsutter.wordpress.com/2008/04/07/visual-c-2008-feature-pack-now-available/">we shipped today</a>.)</p>
<p>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.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/76/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/76/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/76/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/76/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/76/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=76&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/04/07/cringe-not-vectors-are-guaranteed-to-be-contiguous/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual C++ 2008 Feature Pack now available</title>
		<link>http://herbsutter.wordpress.com/2008/04/07/visual-c-2008-feature-pack-now-available/</link>
		<comments>http://herbsutter.wordpress.com/2008/04/07/visual-c-2008-feature-pack-now-available/#comments</comments>
		<pubDate>Mon, 07 Apr 2008 23:58:49 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/?p=75</guid>
		<description><![CDATA[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 [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Back in November, I <a href="http://herbsutter.wordpress.com/2007/11/10/visual-c-announcements-in-barcelona-tr1-and-mfc/">reported</a> 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:</p>
<blockquote><p>The update is expected to be available in beta form in January 2008, and to ship in the first half of 2008. Enjoy!</p></blockquote>
<p>Well, it&#8217;s official: <a href="http://blogs.msdn.com/vcblog/archive/2008/04/07/visual-c-2008-feature-pack-released.aspx">It&#8217;s available.</a> 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):</p>
<blockquote>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;"><span style="font-family:Calibri;"><span>TR1 (“Technical Report 1”) is a set of proposed additions to the C++0x standard.  </span>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.</span></span></p>
<p class="MsoNormal" style="margin:0;"><span style="font-size:small;font-family:Calibri;">More information on TR1 can be found at the sites below:</span></p>
<p class="MsoNormal" style="padding-left:30px;margin:0;"><span style="font-size:small;"><span style="font-family:Calibri;"><a href="http://msdn2.microsoft.com/en-us/library/bb982198.aspx">TR1 documentation</a></span></span></p>
<p class="MsoNormal" style="padding-left:30px;margin:0;"><span style="font-size:small;font-family:Calibri;"><a href="http://channel9.msdn.com/showpost.aspx?postid=385821">Channel 9: Digging into TR1</a></span></p>
<p class="MsoNormal" style="padding-left:30px;margin:0;"><span style="font-size:small;font-family:Calibri;"><a href="http://blogs.msdn.com/vcblog/archive/2008/02/22/tr1-slide-decks.aspx">TR1 slide decks (recommended)</a></span></p>
</blockquote>
<p>Enjoy, everyone - and thanks, team!</p>
<h3>Notes</h3>
<p>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.</p>
<p>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. :-)</p>
<p>3. Yes, I know that June has 30 days.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/75/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/75/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=75&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/04/07/visual-c-2008-feature-pack-now-available/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Trip Report: February/March 2008 ISO C++ Standards Meeting</title>
		<link>http://herbsutter.wordpress.com/2008/03/29/trip-report-februarymarch-2008-iso-c-standards-meeting/</link>
		<comments>http://herbsutter.wordpress.com/2008/03/29/trip-report-februarymarch-2008-iso-c-standards-meeting/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/03/29/trip-report-februarymarch-2008-iso-c-standards-meeting/</guid>
		<description><![CDATA[[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 [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><em>[Updated Apr 3 to note automatic deduction of return type.]</em></p>
<p>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.</p>
<h2>Lambda functions and closures (<a title="N2550" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2550.pdf">N2550</a>)</h2>
<p>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).</p>
<p>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.</p>
<h3>Example: Write collection to console</h3>
<p>For example, let&#8217;s say you want to write each of a collection of Widgets to the console.</p>
<p style="padding-left:30px;">// Writing a collection to cout, in today&#8217;s C++, option 1:</p>
<p style="padding-left:30px;">for( vector&lt;Widget&gt;::iterator i = w.begin(); i != w.end(); ++i )<br />
  cout &lt;&lt; *i &lt;&lt; &#8221; &#8220;;</p>
<p>Or we can leverage that C++ already has a special-purpose ostream_iterator type that does what we want:</p>
<p style="padding-left:30px;">// Writing a collection to cout, in today&#8217;s C++, option 2:</p>
<p style="padding-left:30px;">copy( w.begin(), w.end(),<br />
          ostream_iterator&lt;const Widget&gt;( cout, &#8221; &#8221; ) );</p>
<p>In C++0x, just use a lambda that writes the right function object on the fly:</p>
<p style="padding-left:30px;">// Writing a collection to cout, in C++0x:</p>
<p style="padding-left:30px;">for_each( w.begin(), w.end(),<br />
<span style="color:#000080;">                []( const Widget&amp; w ) { cout &lt;&lt; w &lt;&lt; &#8221; &#8220;; }</span> );</p>
<p>(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. <em>&lt;tease type=&#8221;shameless&#8221;&gt;</em> 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. <em>&lt;/tease&gt;</em>)</p>
<h3>Example: Find element with Weight() &gt; 100</h3>
<p>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:</p>
<p style="padding-left:30px;">// Calling find_if using a functor, in today&#8217;s C++:</p>
<p style="padding-left:30px;">// outside the function, at namespace scope<br />
class GreaterThan {<br />
  int weight;<br />
public:<br />
  GreaterThan( int weight_ )<br />
    : weight(weight_) { }<br />
  bool operator()( const Widget&amp; w ) {<br />
    return w.Weight() &gt; weight;<br />
  }<br />
};</p>
<p style="padding-left:30px;">// at point of use<br />
find_if( w.begin(), w.end(), GreaterThan(100) );</p>
<p>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.</p>
<p>In C++0x, you can just write:</p>
<p style="padding-left:30px;">// Calling find_if using a lambda, in C++0x:</p>
<p style="padding-left:30px;">find_if( w.begin(), w.end(),<br />
<span style="color:#000080;">            []( Widget&amp; w ) { return w.Weight() &gt; 100; }</span> );</p>
<p>Ah. Much better.</p>
<h3>Most algorithms are loops&#8230; hmm&#8230;</h3>
<p>In fact, every loop-like algorithm is now usable as a loop. Quick examples using std::for_each and std::transform:</p>
<p style="padding-left:30px;">for_each( v.begin(), v.end(), <span style="color:#000080;">[]( Widget&amp; w )<br />
{</span><br />
  &#8230;<br />
  &#8230; use or modify w &#8230;<br />
  &#8230;<br />
<span style="color:#000080;">}</span> );</p>
<p style="padding-left:30px;">transform( v.begin(), v.end(), output.begin(), <span style="color:#000080;">[]( Widget&amp; w )<br />
</span>{<br />
  &#8230;<br />
  return SomeResultCalculatedFrom( w );<br />
<span style="color:#000080;">}</span> );</p>
<p>Hmm. Who knows: As C++0x lambdas start to be supported in upcoming compilers, we may start getting more used to seeing &#8220;<strong>});</strong>&#8221; as the end of a loop body.</p>
<h3>Concurrency teaser</h3>
<p>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:</p>
<p style="padding-left:30px;">// Passing work to a thread pool, in C++0x:</p>
<p style="padding-left:30px;">mypool.run( <span style="color:#000080;">[] { cout &lt;&lt; &#8220;Hello there (from the pool)&#8221;; }</span> );</p>
<p>Gnarly.</p>
<h2>Other approved features</h2>
<ul>
<li><a title="N2535" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm">N2535</a> Namespace associations (<strong>inline namespace</strong>)</li>
<li><a title="N2540" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm">N2540</a> Inheriting constructors</li>
<li><a title="N2541" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm">N2541</a> New function declarator syntax</li>
<li><a title="N2543" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2543.htm">N2543</a> STL singly linked lists (<strong>forward_list</strong>)</li>
<li><a title="N2544" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf">N2544</a> Unrestricted unions</li>
<li><a title="N2546" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm">N2546</a> Removal of auto as a storage-class specifier</li>
<li><a title="N2551" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2551.pdf">N2551</a> Variadic template versions of <strong>std::min</strong>, <strong>std::max</strong>, and <strong>std::minmax</strong></li>
<li><a title="N2554" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2554.pdf">N2554</a> Scoped allocator model</li>
<li><a title="N2525" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2525.pdf">N2525</a> Allocator-specific swap and move behavior</li>
<li><a title="N2547" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm">N2547</a> Allow lock-free atomic&lt;T&gt; in signal handlers</li>
<li><a title="N2555" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf">N2555</a> Extended variadic template template parameters</li>
<li><a title="N2559" href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2559.htm">N2559</a> Nesting exceptions (aka wrapped exceptions)</li>
</ul>
<h2>Next Meetings</h2>
<p>Here are the next meetings of the ISO C++ standards committee, with links to meeting information where available.</p>
<ul>
<li>June 8-14, 2008: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2517.pdf">Sophia Antipolis, France</a></li>
<li>September 14-20, 2008: <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2537.html">San Francisco Bay area, California, USA</a></li>
</ul>
<p>The meetings are public, and if you&#8217;re in the area please feel free to drop by.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=5&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/03/29/trip-report-februarymarch-2008-iso-c-standards-meeting/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Concurrency Interview with DevX</title>
		<link>http://herbsutter.wordpress.com/2008/03/28/concurrency-interview-with-devx/</link>
		<comments>http://herbsutter.wordpress.com/2008/03/28/concurrency-interview-with-devx/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Concurrency]]></category>

		<category><![CDATA[Software Development]]></category>

		<category><![CDATA[Talks &amp; Events]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/03/28/concurrency-interview-with-devx/</guid>
		<description><![CDATA[I recently spent an hour on the phone to talk concurrency with DevX&#8217;s Alexa Weber Morales. Part 1 of that interview just went live on the web, and focuses mostly on what concurrency and parallelism are, how to take advantage of multicore chips, and whether concurrency will ever be really accessible to mainstream developers. The [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I recently spent an hour on the phone to talk concurrency with DevX&#8217;s Alexa Weber Morales. <a href="http://www.devx.com/go-parallel/Article/37573">Part 1 of that interview</a> just went live on the web, and focuses mostly on what concurrency and parallelism are, how to take advantage of multicore chips, and whether concurrency will ever be really accessible to mainstream developers. The site seems to be having intermittent problems displaying the pages; just hit the link a few more times if it doesn&#8217;t work right away.</p>
<p><strong>Disclaimer:</strong> I am not responsible for the article title (yikes! &#8220;whisperer&#8221;?! my goodness gracious) and Alexa&#8217;s intro blurb is way too kind. But it is true that it&#8217;s important for us-the-industry to bring concurrency to the mainstream in a grokkable way, as we have already successfully done with OO and GUIs in the past.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/6/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/6/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=6&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/03/28/concurrency-interview-with-devx/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>New Course Available: Effective Concurrency</title>
		<link>http://herbsutter.wordpress.com/2008/03/12/new-course-available-effective-concurrency/</link>
		<comments>http://herbsutter.wordpress.com/2008/03/12/new-course-available-effective-concurrency/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Concurrency]]></category>

		<category><![CDATA[Talks &amp; Events]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/03/12/new-course-available-effective-concurrency/</guid>
		<description><![CDATA[Many of you have kindly sent mail about my Effective Concurrency columns and asking when there&#8217;ll be a course. Well, I&#8217;m happy to announce that the answer is: May 19-21, 2008.
Here&#8217;s the brief information (more details below):

3-Day Seminar: Effective Concurrency
May 19-21, 2008
Bellevue, WA, USA
Developed and taught by Herb Sutter
This course covers the fundamental tools that [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Many of you have kindly sent mail about my Effective Concurrency <a href="http://herbsutter.spaces.live.com/blog/cns!2D4327CC297151BB!513.entry">columns</a> and asking when there&#8217;ll be a course. Well, I&#8217;m happy to announce that the answer is: <a href="http://construx.com/Page.aspx?nid=17&amp;id=108"><strong>May 19-21, 2008</strong></a>.</p>
<p>Here&#8217;s the brief information (more details below):</p>
<blockquote>
<h3><a href="http://construx.com/Page.aspx?nid=17&amp;id=108"><strong><span style="color:#000080;">3-Day Seminar: Effective Concurrency</span></strong></a></h3>
<h4><span style="color:#000080;">May 19-21, 2008<br />
Bellevue, WA, USA<br />
Developed and taught by Herb Sutter</span></h4>
<p><span style="color:#000080;">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: </span></p>
<ul>
<li><span style="color:#000080;">Leverage the ability to perform and manage work asynchronously </span></li>
<li><span style="color:#000080;">Build applications that naturally run faster on new hardware having more and more cores </span></li>
<li><span style="color:#000080;">Manage shared objects in memory effectively to avoid races and deadlocks</span></li>
<li><span style="color:#000080;">Engineer specifically for high performance</span></li>
</ul>
<p><span style="color:#000080;">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.</span></p></blockquote>
<p><strong>Note on class size limit and possible waitlist:</strong> There is a hard limit on attendance at this first one (really). But if the registration site says you&#8217;ll get waitlisted, don&#8217;t give up: Go ahead and sign up anyway because we may be able to put together a second installment of the seminar a week or two later if there&#8217;s enough interest.</p>
<p>Finally, here&#8217;s a summary of what we&#8217;ll cover during the three days.</p>
<blockquote><p><span style="color:#000080;">Fundamentals </span></p>
<ul>
<li><span style="color:#000080;">Define basic concurrency goals and requirements </span></li>
<li><span style="color:#000080;">Understand applications&#8217; scalability needs </span></li>
<li><span style="color:#000080;">Key concurrency patterns </span></li>
</ul>
<p><span style="color:#000080;">Isolation: Keep Work Separate </span></p>
<ul>
<li><span style="color:#000080;">Running tasks in isolation and communicate via async messages </span></li>
<li><span style="color:#000080;">Integrating multiple messaging systems, including GUIs and sockets </span></li>
<li><span style="color:#000080;">Building responsive applications using background workers </span></li>
<li><span style="color:#000080;">Threads vs. thread pools </span></li>
</ul>
<p><span style="color:#000080;">Scalability: Re-enable the Free Lunch </span></p>
<ul>
<li><span style="color:#000080;">When and how to use more cores  </span></li>
<li><span style="color:#000080;">Exploiting parallelism in algorithms  </span></li>
<li><span style="color:#000080;">Exploiting parallelism in data structures  </span></li>
<li><span style="color:#000080;">Breaking the scalability barrier </span></li>
</ul>
<p><span style="color:#000080;">Consistency: Don’t Corrupt Shared State </span></p>
<ul>
<li><span style="color:#000080;">The many pitfalls of locks&#8211;deadlock, convoys, etc. </span></li>
<li><span style="color:#000080;">Locking best practices </span></li>
<li><span style="color:#000080;">Reducing the need for locking shared data </span></li>
<li><span style="color:#000080;">Safe lock-free coding patterns </span></li>
<li><span style="color:#000080;">Avoiding the pitfalls of general lock-free coding </span></li>
<li><span style="color:#000080;">Races and race-related effects </span></li>
</ul>
<p><span style="color:#000080;">Migrating Existing Code Bases to Use Concurrency </span></p>
<p><span style="color:#000080;">Near-Future Tools and Features </span></p>
<p><span style="color:#000080;">High Performance Concurrency </span></p>
<ul>
<li><span style="color:#000080;">Machine architecture and concurrency </span></li>
<li><span style="color:#000080;">Costs of fundamental operations, including locks, context switches, and system calls </span></li>
<li><span style="color:#000080;">Memory and cache effects </span></li>
<li><span style="color:#000080;">Data structures that support and undermine concurrency </span></li>
<li><span style="color:#000080;">Enabling linear and superlinear scaling </span></li>
</ul>
</blockquote>
<p>I hope to get to meet some of you here in the Seattle area!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/7/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/7/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=7&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/03/12/new-course-available-effective-concurrency/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Effective Concurrency: Super Linearity and the Bigger Machine</title>
		<link>http://herbsutter.wordpress.com/2008/03/12/effective-concurrency-super-linearity-and-the-bigger-machine/</link>
		<comments>http://herbsutter.wordpress.com/2008/03/12/effective-concurrency-super-linearity-and-the-bigger-machine/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Concurrency]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/03/12/effective-concurrency-super-linearity-and-the-bigger-machine/</guid>
		<description><![CDATA[The latest Effective Concurrency column, &#34;Super Linearity and the Bigger Machine&#34;, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:
 
There are two main ways to achieve superlinear scalability, or to use P processors to compute an answer more than P times faster&#8230;:

Do disproportionately less work.  [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div>The latest <strong>Effective Concurrency</strong> column, <a href="http://www.ddj.com/hpc-high-performance-computing/206903306"><strong>&quot;Super Linearity and the Bigger Machine&quot;</strong></a>, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:</div>
<blockquote><p><a href="http://q6y8ug.bay.livefilestore.com/y1pkBWHZvSH-13MUZFgAZORnXtMpUGUYQhXK_fvea3U9n4BjiNrzkD8m6iF2NkWt0CogMU_NqttwtB1jdQpnF6zGQ?PARTNER=WRITER"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;" height="137" alt="ec09-fig2" src="http://by2.storage.msn.com/y1pchDoYPr1r3vPM4HYgCWyVlFVVyImNTZsldbIO3vvMHz89fqRktSpBQ969CqhrlXF1E7oLZqdtgx8oV2EbCMbh2ujXLzo-RGO?PARTNER=WRITER" width="244" align="right" border="0" /></a> </p>
<p>There are two main ways to achieve superlinear scalability, or to use P processors to compute an answer more than P times faster&#8230;:
<ul>
<li>Do disproportionately less work.  </li>
<li>Harness disproportionately more resources. </li>
</ul>
<p>Last month, we focused on the first point by illustrating parallel search and how it naturally achieves superlinear speedups when matches are not distributed evenly because some workers get &quot;rich&quot; subranges and will find a match faster, which benefits the whole search because we can stop as soon as any worker finds a match. </p>
<p>This month, we&#8217;ll conclude examining the first point with a few more examples, and then consider how to achieve superlinear speedups by harnessing more resources—quite literally, running on a bigger machine without any change in the hardware. &#8230;</p>
</blockquote>
<div>I hope you enjoy it.</div>
<div> </div>
<div>Finally, here are links to previous Effective Concurrency columns (based on the dates they hit the web, not the magazine print issue dates):</div>
<table cellspacing="5" cellpadding="5" width="555" border="0">
<tbody>
<tr>
<td valign="top" width="114">July 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/200001985">The Pillars of Concurrency</a> </td>
</tr>
<tr>
<td valign="top" width="114">August 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/201202924">How Much Scalability Do You Have or Need?</a> </td>
</tr>
<tr>
<td valign="top" width="114">September 2007 </td>
<td valign="top" width="422"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://ddj.com/cpp/201804238">Use Critical Sections (Preferably Locks) to Eliminate Races</a> </td>
</tr>
<tr>
<td valign="top" width="114">October 2007 </td>
<td valign="top" width="422"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://www.ddj.com/hpc-high-performance-computing/202401098">Apply Critical Sections Consistently</a> </td>
</tr>
<tr>
<td valign="top" width="114">November 2007 </td>
<td valign="top" width="422"><a href="http://herbsutter.spaces.live.com/blog/cns!2D4327CC297151BB!342.entry"></a><a title="Avoid Calling Unknown Code While Inside a Critical Section" href="http://ddj.com/architect/202802983">Avoid Calling Unknown Code While Inside a Critical Section</a> </td>
</tr>
<tr>
<td valign="top" width="114">December 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/204801163">Use Lock Hierarchies to Avoid Deadlock</a> </td>
</tr>
<tr>
<td valign="top" width="114">January 2008 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/cpp/205900309">Break Amdahl&#8217;s Law!</a> </td>
</tr>
<tr>
<td valign="top" width="114">February 2008 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/206100542">Going Superlinear</a> </td>
</tr>
<tr>
<td valign="top" width="114">March 2008 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/206903306">Super Linearity and the Bigger Machine</a></td>
</tr>
</tbody>
</table>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/8/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/8/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=8&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/03/12/effective-concurrency-super-linearity-and-the-bigger-machine/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>

		<media:content url="http://by2.storage.msn.com/y1pchDoYPr1r3vPM4HYgCWyVlFVVyImNTZsldbIO3vvMHz89fqRktSpBQ969CqhrlXF1E7oLZqdtgx8oV2EbCMbh2ujXLzo-RGO?PARTNER=WRITER" medium="image">
			<media:title type="html">ec09-fig2</media:title>
		</media:content>
	</item>
		<item>
		<title>Stroustrup &#38; Sutter: The Lyrics</title>
		<link>http://herbsutter.wordpress.com/2008/03/10/stroustrup-sutter-the-lyrics/</link>
		<comments>http://herbsutter.wordpress.com/2008/03/10/stroustrup-sutter-the-lyrics/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<category><![CDATA[Talks &amp; Events]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/03/10/stroustrup-sutter-the-lyrics/</guid>
		<description><![CDATA[Last week&#8217;s Stroustrup &#38; Sutter on C++ was a huge amount of fun, and Bjarne and I want to thank everyone who came. It was a record-shattering year, and it&#8217;s great to see C++ clearly thriving and growing.
A lot of people requested the (modified) lyrics to the songs we performed (yes, if you missed the [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Last week&#8217;s <a href="http://www.sdexpo.com/2008/west/super_session.htm">Stroustrup &amp; Sutter on C++</a> was a huge amount of fun, and Bjarne and I want to thank everyone who came. It was a record-shattering year, and it&#8217;s great to see C++ clearly thriving and growing.</p>
<p>A lot of people requested the (modified) lyrics to the songs we performed (yes, if you missed the event, you missed live music by geeks &#8212; imagine, if you will). To those who were there: You can now find the song lyrics at the same web page we gave out that contains the course eval link and the updated slides link. Just go back and you&#8217;ll see them, as well as the slides for What Not to Code in the handouts zipfile. Enjoy.</p>
<p>Thanks again for coming, and we hope to see you again next time. (The response to the post-seminar eval question about &#8220;would you recommend this course to a colleague&#8221; was a humbling 100.0%. Wow. It&#8217;s not often I see a pie chart that&#8217;s a solid circle. Thank you, and we&#8217;re glad you enjoyed it!)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/9/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/9/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=9&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/03/10/stroustrup-sutter-the-lyrics/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>How parallelism demos are useful</title>
		<link>http://herbsutter.wordpress.com/2008/02/01/how-parallelism-demos-are-useful/</link>
		<comments>http://herbsutter.wordpress.com/2008/02/01/how-parallelism-demos-are-useful/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Concurrency]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/02/01/how-parallelism-demos-are-useful/</guid>
		<description><![CDATA[In &#34;Break Amdahl&#8217;s Law!&#34;, I described ways to enable scalable applications, and wrote in part:

But don&#8217;t show me ray-traced bouncing balls or Mandelbrot graphics or the other usual embarrassingly parallel but niche (or downright useless) clichés—what we&#8217;re looking for are real ideas of real software we could imagine real kids and grandmothers using that could [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In <a href="http://www.ddj.com/hpc-high-performance-computing/205900309">&quot;Break Amdahl&#8217;s Law!&quot;</a>, I described ways to enable scalable applications, and wrote in part:<br />
<blockquote>
<p><em>But don&#8217;t show me ray-traced bouncing balls or Mandelbrot graphics or the other usual embarrassingly parallel but niche (or downright useless) clichés—what we&#8217;re looking for are real ideas of real software we could imagine real kids and grandmothers using that could become possible on manycore machines. Here&#8217;s a quick potential example: Researchers know how to do speech recognition with near-human-quality accuracy in the lab, which is astonishingly good and would enable breakthrough user interfaces if it could be done that reliably in real time. The only trouble is that the software takes a week to run&#8230;on a single core. Can it be parallelized, and if so how many cores would we need to get a useful answer in a useful time? Bunches of smart people (and the smart money behind them) are investing hard work not only to find out the answer to that question, but also to find more questions like it.</em></p>
</blockquote>
<p>Just to be clear, in the first sentence above I didn&#8217;t mean to say that the standard demos are useless &#8212; far from it (see below). This was intended to be a challenging call to action to not be satisfied with demos alone, but for us as an industry to imagine and develop compelling mainstream end <em>applications</em> that are multicore- and manycore-scalable. (To make that clearer, I&#8217;m going to ditch and rewrite the first sentence above for the <em>Effective Concurrency</em> book.) </p>
<p>The standard demos are indeed important &#8212; not only as proofs of concept, that the technology really does enable scalable parallel code, but at least as importantly as helpful tools in helping us to understand how a given parallel technology or runtime works.<br />
<h3>To understand concurrency mechanics/characteristics</h3>
</p>
<p><a href="http://byfiles.storage.msn.com/y1pgF2c1f0SPofCMQAiM5dB1PppqdilW49_KS1xQn2qa4zx4eVc7cvMPPIJR_ktVwlXFLNJy430II4?PARTNER=WRITER"><img style="border-right:0;border-top:0;border-left:0;border-bottom:0;margin:0 15px 0 0;" height="223" alt="mandlebrot_threads" src="http://byfiles.storage.msn.com/y1pgF2c1f0SPoe6QRyRQ1fJ3DP_TjhDNiBGOEtoe-jVCLTmreSXYR9GAyEZpz26BHAHErWHBPE67po?PARTNER=WRITER" width="244" align="left" border="0" /></a> For example, consider a standard Mandelbrot-rendering demo, but with the twist that each worker thread (core) renders its portion of the work in a different color. On a traditional runtime with static scheduling, some workers with easy-to-compute sections will be done early and wait idly while the other workers finish their harder-to-compute sections, and we can see visually that each colored section is the same size and some colored sections appear faster than others. But on a runtime with dynamic scheduling, and especially one that supports Cilk-style work stealing, we get efficient load balancing where workers who are assigned &quot;easy&quot; sections and are done early can contribute to remaining work in harder-to-compute areas &#8212; and visually some sections fill in with one color but then the same color starts to add to other yet-unfinished sections. The bands of color let us see which worker did what work and helped out in what other areas, and the overall visual progress of the whole image lets us see that the system as a whole is doing useful work the whole time. So the colored Mandelbrot demo is a very useful tool to let us understand what&#8217;s going on quickly and clearly, in a way that presenting the results in a numerical table can&#8217;t.<br />
<h3>To illustrate a path to future applications</h3>
</p>
<p><img style="margin:0 5px 0 10px;" src="http://blogs.intel.com/research/teas_edited-1.jpg" align="right" />Similarly, ray-tracing may well make multicore and manycore CPUs the future of photorealistic graphics in a way that may not be applicable to standard GPUs (time will tell). As shown in the blogs below, ray-tracing makes a qualitative difference in the nature of lighting models. But can&#8217;t we do this already with GPUs? Interestingly, not necessarily; ray-tracing seems to represent an algorithm that is hard to accelerate with GPUs with limited abilities to do the fine-grain scheduling that runtimes based on techniques like work stealing are well suited to do. Some links:
<ul>
<li><a href="http://blogs.intel.com/research/2007/10/real_time_raytracing_the_end_o.php">Intel&#8217;s ray-tracing summary and why it&#8217;s important</a> </li>
<li><a href="http://blogs.intel.com/research/2007/10/more_on_the_future_of_raytraci.php">Followup addressing caveats, why ray-tracing isn&#8217;t necessarily the best choice for everything, but still important</a></li>
</ul>
<h3>Yes, demos are useful</h3>
</p>
<p>My point in the original quote above (which I see I could have stated more clearly) was simply this: Once we&#8217;ve achieved the demos, we shouldn&#8217;t sit back and declare victory. The demos aren&#8217;t the end goal; we still need the applications. </p>
<p>Concurrency demos are useful to help prove a technology can scale and to understand how it works, and some of them show potentially fruitful and exciting paths to real and compelling manycore-exploiting applications, but it&#8217;s still up to us as an industry to continue to imagine and build those applications. I believe that we can and will.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/10/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/10/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=10&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/02/01/how-parallelism-demos-are-useful/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>

		<media:content url="http://byfiles.storage.msn.com/y1pgF2c1f0SPoe6QRyRQ1fJ3DP_TjhDNiBGOEtoe-jVCLTmreSXYR9GAyEZpz26BHAHErWHBPE67po?PARTNER=WRITER" medium="image">
			<media:title type="html">mandlebrot_threads</media:title>
		</media:content>

		<media:content url="http://blogs.intel.com/research/teas_edited-1.jpg" medium="image" />
	</item>
		<item>
		<title>Effective Concurrency: Going Superlinear</title>
		<link>http://herbsutter.wordpress.com/2008/01/30/effective-concurrency-going-superlinear/</link>
		<comments>http://herbsutter.wordpress.com/2008/01/30/effective-concurrency-going-superlinear/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Concurrency]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/01/30/effective-concurrency-going-superlinear/</guid>
		<description><![CDATA[
The latest Effective Concurrency column, &#34;Going Superlinear&#34;, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:
We spend most of our scalability lives inside a triangular box, shown in Figure 1. It reminds me of the early days of flight: We try to lift ourselves away from the [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>
<div>The latest <strong>Effective Concurrency</strong> column, <a href="http://www.ddj.com/hpc-high-performance-computing/206100542"><strong>&quot;Going Superlinear&quot;</strong></a>, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:</div>
<blockquote><p><img src="http://i.cmpnet.com/ddj/images/article/2008/0802/080201hs01_f1.gif" align="right" />We spend most of our scalability lives inside a triangular box, shown in Figure 1. It reminds me of the early days of flight: We try to lift ourselves away from the rough ground of zero scalability and fly as close as possible to the cloud ceiling of linear speedup. Normally, the Holy Grail of parallel scalability is to linearly use <em>P</em> processors or cores to complete some work almost <em>P</em> times faster, up to some hopefully high number of cores before our code becomes bound on memory or I/O or something else that means diminishing returns for adding more cores. As Figure 1 illustrates, the traditional shape of our &quot;success&quot; curve lies inside the triangle. </p>
<p>Sometimes, however, we can equip our performance plane with extra tools and safely break through the linear ceiling into the superlinear stratosphere. So the question is: &quot;Under what circumstances can we use P cores to do work more than <em>P</em> times faster?&quot; There are two main ways to enter that rarefied realm:
<ul>
<li>Do disproportionately less work.  </li>
<li>Harness disproportionately more resources. </li>
</ul>
<p>This month and next, we&#8217;ll consider situations and techniques that fall into one or both of these categories. &#8230;</p>
</blockquote>
<div>I hope you enjoy it.</div>
<div> </div>
<div>Finally, here are links to previous Effective Concurrency columns (based on the dates they hit the web, not the magazine print issue dates):</div>
<table cellspacing="5" cellpadding="5" width="555" border="0">
<tbody>
<tr>
<td valign="top" width="114">July 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/200001985">The Pillars of Concurrency</a> </td>
</tr>
<tr>
<td valign="top" width="114">August 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/201202924">How Much Scalability Do You Have or Need?</a> </td>
</tr>
<tr>
<td valign="top" width="114">September 2007 </td>
<td valign="top" width="422"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://ddj.com/cpp/201804238">Use Critical Sections (Preferably Locks) to Eliminate Races</a> </td>
</tr>
<tr>
<td valign="top" width="114">October 2007 </td>
<td valign="top" width="422"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://www.ddj.com/hpc-high-performance-computing/202401098">Apply Critical Sections Consistently</a> </td>
</tr>
<tr>
<td valign="top" width="114">November 2007 </td>
<td valign="top" width="422"><a href="http://herbsutter.spaces.live.com/blog/cns!2D4327CC297151BB!342.entry"></a><a title="Avoid Calling Unknown Code While Inside a Critical Section" href="http://ddj.com/architect/202802983">Avoid Calling Unknown Code While Inside a Critical Section</a> </td>
</tr>
<tr>
<td valign="top" width="114">December 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/204801163">Use Lock Hierarchies to Avoid Deadlock</a> </td>
</tr>
<tr>
<td valign="top" width="114">January 2008 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/cpp/205900309">Break Amdahl&#8217;s Law!</a> </td>
</tr>
<tr>
<td valign="top" width="114">February 2008 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/206100542">Going Superlinear</a></td>
</tr>
</tbody>
</table>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/11/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/11/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=11&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/01/30/effective-concurrency-going-superlinear/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>

		<media:content url="http://i.cmpnet.com/ddj/images/article/2008/0802/080201hs01_f1.gif" medium="image" />
	</item>
		<item>
		<title>What Not To Code</title>
		<link>http://herbsutter.wordpress.com/2008/01/28/what-not-to-code/</link>
		<comments>http://herbsutter.wordpress.com/2008/01/28/what-not-to-code/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/01/28/what-not-to-code/</guid>
		<description><![CDATA[At Stroustrup &#38; Sutter on C++ this March, one of my sessions will be on &#34;What Not To Code&#34; (submission link). The premise is to try something new I haven&#8217;t done before: A session dedicated to making over code nominated by you, the public, in the few weeks before the talk. 
In return for your [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>At <a href="http://www.sdexpo.com/2008/west/super_session.htm">Stroustrup &amp; Sutter on C++</a> this March, one of my sessions will be on <a href="http://herbsutter.whatnottocode.sgizmo.com/">&quot;What Not To Code&quot; <strong>(submission link)</strong></a>. The premise is to try something new I haven&#8217;t done before: A session dedicated to making over code nominated by <em>you</em>, the public, in the few weeks before the talk. </p>
<p>In return for your submission, here&#8217;s what I&#8217;ll do if your entry is selected:
<ul>
<li><strong>Full notes:</strong> Whether or not you attend the S&amp;S event, I&#8217;ll send you the full talk handouts &#8212; not only for your submission, but for all selected submissions &#8212; as your thank-you for participating. </li>
<li><strong>Participation:</strong> If you&#8217;re there in the audience, you can participate in the makeover on stage (if you want to, your choice). Oh, and there might be an additional live prize.</li>
</ul>
<p>I&#8217;ll select as many of the submissions as I can, and analyze/critique/improve them during the session, including talking about tradeoffs and alternatives that can make the code clearer, faster, simpler, and/or safer. As the talk blurb concludes:<br />
<blockquote>
<p>&#8230; you will refresh your sense of elegance and beauty, not to mention old-fashioned performance and robustness and maintainability, so often lacking in the broken code littering today&#8217;s bleak postmodern corporate landscape.</p>
</blockquote>
<p>So if you&#8217;ve seen a friend&#8217;s or coworker&#8217;s (or your own) code that could use a makeover, <a href="http://herbsutter.whatnottocode.sgizmo.com/"><strong>please nominate it anytime here</strong></a>. Thanks!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/12/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/12/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/12/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/12/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/12/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=12&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/01/28/what-not-to-code/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Many Books</title>
		<link>http://herbsutter.wordpress.com/2008/01/25/many-books/</link>
		<comments>http://herbsutter.wordpress.com/2008/01/25/many-books/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Friday Thoughts]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/01/25/many-books/</guid>
		<description><![CDATA[When I walk into a Chapters or a Borders, seeing the many shelves of books often recalls the ancient writer&#8217;s words about quality vs. quantity, circa 1000 BC:

&#34;To the making of many books there is no end.&#34;

So true. Yet that observation predates the printing press&#8230; and netnews&#8230; and now RSS. 
(Yes, I&#8217;ve been thinking of [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>When I walk into a Chapters or a Borders, seeing the many shelves of books often recalls the ancient writer&#8217;s words about quality vs. quantity, circa 1000 BC:<br />
<blockquote>
<p>&quot;To the making of many books there is no end.&quot;</p>
</blockquote>
<p>So true. Yet that observation predates the printing press&#8230; and netnews&#8230; and now RSS. </p>
<p><font color="#c0c0c0">(Yes, I&#8217;ve been thinking of managing-down my Google Reader subscriptions again&#8230;)</font></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/13/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/13/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/13/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/13/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/13/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=13&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/01/25/many-books/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Stroustrup &#38; Sutter on C++: March 3-4, 2008, in Santa Clara, CA, USA</title>
		<link>http://herbsutter.wordpress.com/2008/01/22/stroustrup-sutter-on-c-march-3-4-2008-in-santa-clara-ca-usa/</link>
		<comments>http://herbsutter.wordpress.com/2008/01/22/stroustrup-sutter-on-c-march-3-4-2008-in-santa-clara-ca-usa/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/01/22/stroustrup-sutter-on-c-march-3-4-2008-in-santa-clara-ca-usa/</guid>
		<description><![CDATA[ 
I&#8217;m pleased to announce that Bjarne and I are going to have another two-day event co-located with SD West in San Jose, California, this March. Most of the talks are new ones we&#8217;ve never given publicly before, along with updated classics that people liked the best in the past. This year, three of my [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://www.sdexpo.com/2008/west/super_session.htm"><img style="border-width:0;" height="104" alt="pic" src="http://by1.storage.msn.com/y1pchDoYPr1r3s8N6AjMxQAhCfJajHIsxtEOzgeeclOSZXnJQy9f5VMbjxSzesCAXWpz_IuOxKRK7kDHHbWunBct0440-n8c2Ac?PARTNER=WRITER" width="484" border="0" /></a> </p>
<p>I&#8217;m pleased to announce that <a href="http://www.research.att.com/~bs/">Bjarne</a> and I are going to have another two-day event co-located with SD West in San Jose, California, this March. Most of the talks are new ones we&#8217;ve never given publicly before, along with updated classics that people liked the best in the past. This year, three of my four talks have a strong emphasis on concurrency: making your application manycore-scalable, safe locking, and bleeding-fast lock-free coding. </p>
<p>SD graciously let me publish an extra-discount code for readers of this blog. Here it is&#8230; if you register before Feb 8, use the following code to get the early bird price (up to $300 off) plus an extra $50 off any package:<br />
<blockquote>
<p><font size="3"><em>Discount code:  <strong>8WSUT</strong>  (expires Feb 8)</em></font></p>
</blockquote>
<p>Here&#8217;s a link to the conference site, and their summary:<br />
<blockquote>
<p><a href="http://www.sdexpo.com/2008/west/super_session.htm"><strong><font color="#0000ff" size="3">Stroustrup &amp; Sutter #4</font></strong></a><font color="#0000ff" size="3"> </font> </p>
<p><font color="#000080"><strong>Back with brand new and freshly updated content!</strong></font> </p>
<p><font color="#000080">The preeminent super session on the C++ language is back at SD West—and full of new and updated material! Join Bjarne Stroustrup, C++ creator and original implementer, and Herb Sutter, C++ and concurrency guru, for two jam-packed days of new and completely updated courses. The seminar is filled with instructive, revealing and highly pragmatic material, and is structured with both talks and panels—not to mention liberal break times, so that the instructors and attendees can mix, eat and chat together.</font> </p>
<p><font color="#000080">In addition to lots of information you can use today, Herb and Bjarne will also reveal important, forward-looking information about what’s coming in the next version of the C++ Standard, C++0x, and related efforts. As key designers of several of the new core features, their personal experiences are invaluable.</font></p>
</blockquote>
<p>Finally, for convenience, below is a cut-and-paste of the session topics and abstracts.  </p>
<p>I look forward to seeing many of you in San Jose! Best wishes,  </p>
<p>Herb  </p>
<p>
<h2><strong>DAY 1: Monday, March 3</strong></h2>
<h3><strong>C++0x Overview </strong></h3>
</p>
<p>Bjarne Stroustrup </p>
<p>We now know the expected contents of the next C++ Standard, which is targeted to be feature-complete in mid-2008 with final text in 2009. This presentation articulates the main principles of the design of C++0x, outlines the ISO C++ standards process, summarizes the new features and libraries, and gives key examples using new features. Major features, such as concepts, the memory model, and major libraries (such as threads and regular expression matching) are covered by other tutorials, so they will be only briefly mentioned here. The focus of this presentation is the various &quot;minor&quot; features, such as the unified initializer syntax (including variable length initializer lists), decltype and the new form of auto, template aliases, nullptr, generalized constant expressions, &quot;strong&quot; enumerations, the new for statement, static assertions, and rvalue references. But a language is far more than a mere list of features: My aim is to show how these features fit together and fit with C++98 features to better support programming techniques. As ever, the ultimate aim of this language design is to allow clearer expression of real-world ideas, leading to better-performing and easier-to-maintain code. Even the &quot;minor features&quot; can significantly affect your programming style.<br />
<h3><strong>What Not to Code: Avoiding Bad Design Choices and Worse Implementations</strong></h3>
</p>
<p>Herb Sutter  </p>
<p>Our reality show premise is simple: Friends and coworkers nominate code that they consider poorly &quot;fashioned&quot; and ask the show to make over the victim. Our Code Police swoop in with a deal: We&#8217;ll provide up to 15 minutes of public assistance in the form of amusing analyses and insightful improvements, discussing tradeoffs and alternatives that can make the code clearer, faster, simpler, and/or safer&#8230; but only on the condition that they allow our instructor (that&#8217;s Herb) to ruthlessly critique their existing code, and in some cases throw it out altogether, in front of a live studio audience (that&#8217;s you). As members of that interactive audience, you will refresh your sense of elegance and beauty, not to mention old-fashioned performance and robustness and maintainability, so often lacking in the broken code littering today&#8217;s bleak postmodern corporate landscape.<br />
<h3><strong>How to Design Good Interfaces </strong></h3>
</p>
<p>Bjarne Stroustrup  </p>
<p>So: We have classes, derived classes, virtual bases, templates, const, overloading, exceptions, and a host of other useful language features. How do we use them to produce well performing maintainable code? All too often we get seduced into using powerful language features to write clever (i.e., complicated) code rather than to simplify our interfaces and to make the organization of our code easier to understand. This presentation is a tour of the most useful C++ features from the point of view of how they can be used to express the structure of code and to define interfaces that serve basic needs such as flexibility, early error detection, acceptable compile time, performance, decent error reporting, and maintainability.<br />
<h3><strong>How to Migrate C++ Code to the Manycore &quot;Free Lunch&quot; </strong></h3>
</p>
<p>Herb Sutter  </p>
<p>For decades, we enjoyed the &quot;free lunch&quot; of seeing existing applications naturally run faster on new hardware with a faster single CPU core. Computation power is still growing, but in a fundamentally different direction &#8212; more and more cores. We can regain the free lunch, but only by building applications in new ways that correctly apply concurrency and parallelism to express lots of latent concurrency that can scale well to a given number of cores but avoids penalizing the application when running on older hardware with one or few cores. This talk addresses the question of how to design new code, and how to migrate existing code, to be multicore/manycore enabled. We will cover best practices for finding and exploiting parallelism in algorithms and data structures, avoiding data structures that harm concurrency, using thread pools and background tasks effectively, and ways to cheat (if not entirely avoid) the specter of Amdahl&#8217;s Law. Most code examples will be illustrated using draft standard C++0x syntax, but can be directly translated to popular platforms and concurrency libraries, including Linux, Windows, .NET, and pthreads.<br />
<h3><strong>Grill the Experts: Ask Us Anything! </strong></h3>
</p>
<p>Bjarne Stroustrup and Herb Sutter  </p>
<p>This is your opportunity to get &quot;thought leader&quot; answers to your favorite C++ questions! We strongly encourage you to submit your questions in advance, preferably by email or in writing at the beginning of the seminar. Audience questions will also be taken from the floor. Both instructors will answer as many questions as time permits.<br />
<h2><strong>DAY 2: Tuesday, March 4</strong></h2>
<h3><strong>&quot;Best of Stroustrup &amp; Sutter&quot;: </strong>Concepts and Generic Programming in C++0x</h3>
</p>
<p>(Update of talk voted “Most Informative” at S&amp;S 2007)<br />Bjarne Stroustrup  </p>
<p>An updated version of the talk voted &quot;Most Informative&quot; at S&amp;S 2007: C++ templates are immensely flexible and the basis of most modern C++ high-performance programming techniques and of many el<br />
egant library designs. They are the key language feature behind the standard library&#8217;s algorithms and containers: the STL. However, they can also be tricky to use, cause spectacularly bad error messages when misused, and sometimes require unreasonable amounts of code to express apparently simple ideas. C++0x will address these issues directly, and the key to resolving the problems with templates without loss of flexibility or loss of performance is &quot;concepts.&quot; Concepts provide a type system for C++ types and for combinations of C++ types and values. Thus, we are able to provide what feels a lot like conventional type checking for template arguments (including simple and elegant overloading based on template arguments). This presentation explains the notion of concepts and shows how to use concepts to write clearer and more robust generic code using templates. People who can&#8217;t wait for C++0x before trying out concepts (and other new C++0x features related to generic programming) can try the proof-of-concept implementation, ConceptGCC.<br />
<h3><strong>Safe Locking: Best Practices to Eliminate Race Conditions </strong></h3>
</p>
<p>Herb Sutter  </p>
<p>From many core to web services, writing highly concurrent software is increasingly becoming a mainstream requirement. But how can we best manage shared state, specifically objects in shared memory? We need to chart a safe course between the Scylla of data corruption due to race conditions on one side, and the Charybdis of excessive contention and even deadlock or livelock on the other side. This talk covers these important problems, as well as the simplicity vs. scalability tradeoff and the composability conundrum. It focuses on solutions, from basics like scoped locks through correct use of lock hierarchies, disciplines to associate data with locks, essential guidelines for writing lock-safe code, and other important best practices. Most code examples will be illustrated using draft standard C++0x syntax, but can be directly translated to popular platforms and concurrency libraries, including Linux, Windows, .NET, and pthreads.<br />
<h3><strong>Q&amp;A: C++ Design and Evolution </strong></h3>
</p>
<p>Bjarne Stroustrup  </p>
<p>This is a unique opportunity for a &quot;fireside interview&quot; with the creator of C++, moderated by Herb Sutter. After a brief introduction and opening thoughts, Bjarne Stroustrup will take all questions and share thoughtful observations on topics ranging from essential trends affecting software development across languages today, to observations on the strengths and applicability of existing and new languages, to the role of C++ in the 21st century, and more. Attendees are strongly encouraged to submit questions in advance.<br />
<h3><strong>Lock-Free Programming in C++—or How to Juggle Razor Blades </strong></h3>
</p>
<p>Herb Sutter  </p>
<p>Concurrent programs increasingly face pressure to avoid locks altogether. This talk focuses on techniques we can sometimes apply to avoid the need for locking and its difficulties. We will cover many effective best practices, from ways to avoid or better manage shared state through to effective use of atomic operations for lock-free coding, including patterns like lock-free mailboxes, low-contention lazy initialization, internally versioned objects, and more. Most code examples will be illustrated using draft standard C++0x syntax and the C++0x memory model, but can be directly translated to popular platforms and concurrency libraries, including Linux, Windows, .NET, and pthreads.<br />
<h3><strong>Discussion on Questions Raised During the Seminar </strong></h3>
</p>
<p>Herb Sutter and Bjarne Stroustrup  </p>
<p>This panel is set aside for follow-up comments and discussion on issues that are raised during the seminar. During the other talks and panels, or during between-session chats, questions often come up that the instructors want to research. Some of the resulting information will be of general interest, and this final panel provides the needed convenient opportunity to promulgate it to everyone.</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=14&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/01/22/stroustrup-sutter-on-c-march-3-4-2008-in-santa-clara-ca-usa/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>

		<media:content url="http://by1.storage.msn.com/y1pchDoYPr1r3s8N6AjMxQAhCfJajHIsxtEOzgeeclOSZXnJQy9f5VMbjxSzesCAXWpz_IuOxKRK7kDHHbWunBct0440-n8c2Ac?PARTNER=WRITER" medium="image">
			<media:title type="html">pic</media:title>
		</media:content>
	</item>
		<item>
		<title>Newton on Tact</title>
		<link>http://herbsutter.wordpress.com/2008/01/18/newton-on-tact/</link>
		<comments>http://herbsutter.wordpress.com/2008/01/18/newton-on-tact/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Friday Thoughts]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/01/18/newton-on-tact/</guid>
		<description><![CDATA[&#34;Tact is the knack of making a point without making an enemy.&#34;
       ]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>&quot;Tact is the knack of making a point without making an enemy.&quot;</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/15/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/15/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=15&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/01/18/newton-on-tact/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Effective Concurrency: Break Amdahl&#8217;s Law!</title>
		<link>http://herbsutter.wordpress.com/2008/01/17/effective-concurrency-break-amdahls-law/</link>
		<comments>http://herbsutter.wordpress.com/2008/01/17/effective-concurrency-break-amdahls-law/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Concurrency]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/01/17/effective-concurrency-break-amdahls-law/</guid>
		<description><![CDATA[The latest Effective Concurrency column, &#34;Break Amdahl&#8217;s Law!&#34;, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:
Back in 1967, Gene Amdahl famously pointed out what seemed like a fundamental limit to how fast you can make your concurrent code: Some amount of a program&#8217;s processing is fully [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div>The latest <strong>Effective Concurrency</strong> column, <a href="http://www.ddj.com/cpp/205900309"><strong>&quot;Break Amdahl&#8217;s Law!&quot;</strong></a>, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:</div>
<blockquote><p>Back in 1967, Gene Amdahl famously pointed out what seemed like a fundamental limit to how fast you can make your concurrent code: Some amount of a program&#8217;s processing is fully &quot;<i>O(N)</i>&quot; parallelizable (call this portion <i>p</i>), and only that portion can scale directly on machines having more and more processor cores. The rest of the program&#8217;s work is &quot;<i>O(1)</i>&quot; sequential (<i>s</i>). [1,2] Assuming perfect use of all available cores and no parallelization overhead, Amdahl&#8217;s Law says that the best possible speedup of that program workload on a machine with <i>N</i> cores is given by </p>
<p><img height="63" src="http://i.cmpnet.com/ddj/images/article/2008/0801/080101hs01_q1.gif" width="233" border="0" /> </p>
<p>Note that, as <i>N</i> increases to infinity, the best speedup we can ever get is <i>(s+p)/s</i>. Figure 1 illustrates why a program that is half scalably parallelizable and half not won&#8217;t scale beyond a factor of two even given infinite cores. Some people find this depressing. They conclude that Amdahl&#8217;s Law means there&#8217;s no point in trying to write multicore- and manycore-exploiting applications except for a few &quot;embarrassingly parallel&quot; patterns and problem domains with essentially no sequential work at all. </p>
<p>Fortunately, they&#8217;re wrong. If Amdahl&#8217;s Game is rigged, well then, to paraphrase a line from the movie <i>WarGames</i>: The only way to win is not to play. &#8230;</p>
</blockquote>
<div>I hope you enjoy it.</div>
<div> </div>
<div>Finally, here are links to previous Effective Concurrency columns (based on the dates they hit the web, not the magazine print issue dates):</div>
<table cellspacing="5" cellpadding="5" width="555" border="0">
<tbody>
<tr>
<td valign="top" width="114">July 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/200001985">The Pillars of Concurrency</a> </td>
</tr>
<tr>
<td valign="top" width="114">August 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/201202924">How Much Scalability Do You Have or Need?</a> </td>
</tr>
<tr>
<td valign="top" width="114">September 2007 </td>
<td valign="top" width="422"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://ddj.com/cpp/201804238">Use Critical Sections (Preferably Locks) to Eliminate Races</a> </td>
</tr>
<tr>
<td valign="top" width="114">October 2007 </td>
<td valign="top" width="422"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://www.ddj.com/hpc-high-performance-computing/202401098">Apply Critical Sections Consistently</a> </td>
</tr>
<tr>
<td valign="top" width="114">November 2007 </td>
<td valign="top" width="422"><a href="http://herbsutter.spaces.live.com/blog/cns!2D4327CC297151BB!342.entry"></a><a title="Avoid Calling Unknown Code While Inside a Critical Section" href="http://ddj.com/architect/202802983">Avoid Calling Unknown Code While Inside a Critical Section</a> </td>
</tr>
<tr>
<td valign="top" width="114">December 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/204801163">Use Lock Hierarchies to Avoid Deadlock</a></td>
</tr>
</tbody>
</table>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/16/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/16/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/16/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/16/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/16/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=16&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/01/17/effective-concurrency-break-amdahls-law/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>

		<media:content url="http://i.cmpnet.com/ddj/images/article/2008/0801/080101hs01_q1.gif" medium="image" />
	</item>
		<item>
		<title>GotW #88: A Candidate For the &#8220;Most Important const&#8221;</title>
		<link>http://herbsutter.wordpress.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/</link>
		<comments>http://herbsutter.wordpress.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/</guid>
		<description><![CDATA[A friend recently asked me whether Example 1 below is legal, and if so what it means. It led to a nice discussion I thought I&#8217;d post here. Since it was in close to GotW style already, I thought I&#8217;d do another honorary one after all these years&#8230; no, I have not made a New [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>A friend recently asked me whether Example 1 below is legal, and if so what it means. It led to a nice discussion I thought I&#8217;d post here. Since it was in close to <a href="http://www.gotw.ca/gotw/">GotW</a> style already, I thought I&#8217;d do another honorary one after all these years&#8230; no, I have not made a New Year&#8217;s Resolution to resume writing regular GotWs. :-)</p>
<h2>JG Questions</h2>
<h3>Q1: Is the following code legal C++?</h3>
<blockquote>
<p>// Example 1
</p>
<p>string f() { return &quot;abc&quot;; }
</p>
<p>void g() {<br /> <strong>const string&amp; s</strong> = f();<br />  cout &lt;&lt; s &lt;&lt; endl;    // can we still use the &quot;temporary&quot; object?<br />}</p>
</blockquote>
<h3>A1: Yes.</h3>
</p>
<p>This is a C++ feature… the code is valid and does exactly what it appears to do.
</p>
<p>Normally, a temporary object lasts only until the end of the full expression in which it appears. However, C++ deliberately specifies that binding a temporary object to a reference <em>to const</em> on the stack lengthens the lifetime of the temporary to the lifetime of the reference itself, and thus avoids what would otherwise be a common dangling-reference error. In the example above, the temporary returned by f() lives until the closing curly brace. (Note this only applies to stack-based references. It doesn&#8217;t work for references that are members of objects.)
</p>
<p>Does this work in practice? Yes, it works on all compilers I tried (except <a href="http://digitalmars.com/download/freecompiler.html">Digital Mars</a> 8.50, so I sent a bug report to Walter to rattle his cage :-) and he quickly fixed it for the Digital Mars 8.51.0 beta).</p>
<h3>Q2: What if we take out the const&#8230; is Example 2 still legal C++?</h3>
<blockquote>
<p>// Example 2
</p>
<p>string f() { return &quot;abc&quot;; }
</p>
<p>void g() {<br /> <strong>string&amp; s</strong> = f();       // still legal?<br />  cout &lt;&lt; s &lt;&lt; endl;<br />}</p>
</blockquote>
<h3>A2: No.</h3>
</p>
<p>The &quot;const&quot; is important. The first line is an error and the code won&#8217;t compile portably with this reference to non-const, because f() returns a temporary object (i.e., rvalue) and only lvalues can be bound to references to non-const.
</p>
<p>Note: Visual C++ does allow Example 2 but emits a &quot;nonstandard extension used&quot; warning by default. A conforming C++ compiler can always allow otherwise-illegal C++ code to compile and give it some meaning &#8212; hey, it could choose to allow inline COBOL if some kooky compiler writer was willing to implement that extension, maybe after a few too many Tequilas. For some kinds of extensions the C++ standard requires that the compiler at least emit some diagnostic to say that the code isn&#8217;t valid ISO C++, as this compiler does.
</p>
<p>I once heard <a href="http://erdani.org/">Andrei Alexandrescu</a> give a talk on <a href="http://www.ddj.com/cpp/184403758">ScopeGuard</a> (invented by <a href="http://www.petrum.net/">Petru Marginean</a>) where he used this C++ feature and called it &quot;the most important <strong>const</strong> I ever wrote.&quot; And this brings us to the Guru Question, which highlights the additional subtlety that Andrei&#8217;s code deftly leveraged&#8230;</p>
<h2></h2>
</p>
<p><u></u></p>
<h2>Guru Question</h2>
<h3>Q3: When the reference goes out of scope, which destructor gets called?</h3>
<h3>A3: The same destructor that would be called for the temporary object. It&#8217;s just being delayed.</h3>
</p>
<p>Corollary: You can take a const Base&amp; to a Derived temporary and it will be destroyed <em>without virtual dispatch on the destructor call</em>.
</p>
<p>This is nifty. Consider the following code:</p>
<blockquote>
<p>// Example 3
</p>
<p>Derived factory(); // construct a Derived object
</p>
<p>void g() {<br />  const Base&amp; b = factory(); // calls Derived::Derived here<br />  // … use b …<br />} // <b>calls Derived::~Derived directly here</b> &#8212; not Base::~Base + virtual dispatch!</p>
</blockquote>
<p>Does this work in practice on real compilers? Yes: Every compiler I have access to calls the correct Derived destructor, including even ancient Borland 5.5 and Visual C++ 6.0 (and Digital Mars, though DM calls the destructor at the wrong time, as noted above).
</p>
<p>Andrei leverages this subtlety (of course) in his ScopeGuard implementation to avoid making the implementation classes&#8217; destructors virtual at all, which is okay in that case because those classes otherwise have no need for one.
</p>
</p>
<p><em>Updates:</em></p>
<ul>
<li><em>08.01.02 to emphasize </em><em>the feature applies to stack-based references, and mention Walter&#8217;s fix for DM.</em>
</li>
<li><em>08.02.05 to clarify Petru Marginean invented ScopeGuard. </em></li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/herbsutter.wordpress.com/17/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/herbsutter.wordpress.com/17/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/herbsutter.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/herbsutter.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/herbsutter.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/herbsutter.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/herbsutter.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/herbsutter.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/herbsutter.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/herbsutter.wordpress.com/17/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/herbsutter.wordpress.com/17/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/herbsutter.wordpress.com/17/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=herbsutter.wordpress.com&blog=3379246&post=17&subd=herbsutter&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://herbsutter.wordpress.com/2008/01/01/gotw-88-a-candidate-for-the-most-important-const/feed/</wfw:commentRss>
	
		<media:content url="http://a.wordpress.com/avatar/herbsutter-128.jpg" medium="image">
			<media:title type="html">Herb Sutter</media:title>
		</media:content>
	</item>
		<item>
		<title>Effective Concurrency: Use Lock Hierarchies to Avoid Deadlock</title>
		<link>http://herbsutter.wordpress.com/2007/12/11/effective-concurrency-use-lock-hierarchies-to-avoid-deadlock/</link>
		<comments>http://herbsutter.wordpress.com/2007/12/11/effective-concurrency-use-lock-hierarchies-to-avoid-deadlock/#comments</comments>
		<pubDate>Thu, 01 Jan 1970 00:00:00 +0000</pubDate>
		<dc:creator>Herb Sutter</dc:creator>
		
		<category><![CDATA[Concurrency]]></category>

		<guid isPermaLink="false">http://herbsutter.wordpress.com/2007/12/11/effective-concurrency-use-lock-hierarchies-to-avoid-deadlock/</guid>
		<description><![CDATA[The latest Effective Concurrency column, &#34;Use Lock Hierarchies to Avoid Deadlock&#34;, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:
&#8230; The only way to eliminate such a potential deadlock is to make sure that all mutexes ever held at the same time are acquired in a consistent order. [...]]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><div><img style="margin:0 0 10px 15px;" height="260" src="http://i.cmpnet.com/ddj/images/article/2007/0712/071201hs01_f1.gif" width="287" align="right" />The latest <strong>Effective Concurrency</strong> column, <a href="http://www.ddj.com/hpc-high-performance-computing/204801163"><strong>&quot;Use Lock Hierarchies to Avoid Deadlock&quot;</strong></a>, just went live on DDJ&#8217;s site, and will also appear in the print magazine. From the article:</div>
<blockquote><p>&#8230; The only way to eliminate such a potential deadlock is to make sure that all mutexes ever held at the same time are acquired in a consistent order. But how can we ensure this in a way that will be both usable and correct? For example, we could try to figure out which groups of mutexes might ever be held at the same time, and then try to define pairwise ordering rules that cover each possible combination. But that approach by itself is prone to accidentally missing unexpected combinations of locks; and even if we did it perfectly, the result would still be at best &quot;DAG spaghetti&quot;—a directed acyclic graph (DAG) that nobody could comprehend as a whole. And every time we want to add a new mutex to the system, we would have to find a way fit it into the DAG without creating any cycles. </p>
<p>We can do better by directly exploiting the knowledge we already have about the structure of the program to regularize the mess and make it understandable. &#8230;</p>
</blockquote>
<div>I hope you enjoy it.</div>
<div> </div>
<div>Finally, here are links to previous Effective Concurrency columns (based on the dates they hit the web, not the magazine print issue dates):</div>
<table cellspacing="5" cellpadding="5" width="555" border="0">
<tbody>
<tr>
<td valign="top" width="114">July 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/200001985">The Pillars of Concurrency</a> </td>
</tr>
<tr>
<td valign="top" width="114">August 2007 </td>
<td valign="top" width="422"><a href="http://www.ddj.com/hpc-high-performance-computing/201202924">How Much Scalability Do You Have or Need?</a> </td>
</tr>
<tr>
<td valign="top" width="114">September 2007 </td>
<td valign="top" width="422"><a title="Use Critical Sections (Preferably Locks) to Eliminate Races" href="http://ddj.com/cpp/201804238">Use Critical Sections (Preferably Locks) to Eliminate Races</a> </td>
</tr