<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Effective Concurrency: volatile vs. volatile</title>
	<atom:link href="http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/feed/" rel="self" type="application/rss+xml" />
	<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/</link>
	<description>Herb Sutter on software, hardware, and concurrency</description>
	<lastBuildDate>Sat, 14 Nov 2009 15:42:31 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Herb Sutter</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1431</link>
		<dc:creator>Herb Sutter</dc:creator>
		<pubDate>Mon, 10 Aug 2009 20:37:08 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1431</guid>
		<description>@Yang: That&#039;s not quite true. In .NET today, &#039;volatile&#039; operations are sequentially consistent (SC, fully ordered) except only that a volatile store followed by a volatile load can be reordered. This is true on both x86/x64 and Itanium. This doesn&#039;t affect most uses of volatile, although Joe Duffy correctly explains in that article and in his blog that there are situations where it can change the expected meaning of code. I consider this a weakness, and am working with the CLR team to make .NET volatiles be SC in a future release post-VS2010 as part of my Prism memory model work. Note that the above does not apply to Java volatiles, which have been guaranteed to be SC since JSR-133 / Java 5.</description>
		<content:encoded><![CDATA[<p>@Yang: That&#8217;s not quite true. In .NET today, &#8216;volatile&#8217; operations are sequentially consistent (SC, fully ordered) except only that a volatile store followed by a volatile load can be reordered. This is true on both x86/x64 and Itanium. This doesn&#8217;t affect most uses of volatile, although Joe Duffy correctly explains in that article and in his blog that there are situations where it can change the expected meaning of code. I consider this a weakness, and am working with the CLR team to make .NET volatiles be SC in a future release post-VS2010 as part of my Prism memory model work. Note that the above does not apply to Java volatiles, which have been guaranteed to be SC since JSR-133 / Java 5.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yang</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1424</link>
		<dc:creator>Yang</dc:creator>
		<pubDate>Sun, 09 Aug 2009 23:46:58 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1424</guid>
		<description>Your article states that for .NET, `volatile` operations cannot be reordered (implies a memory barrier) . However, according to the following article (and various other resources I&#039;ve encountered on the web):

http://msdn.microsoft.com/en-us/magazine/cc817398.aspx

operations are allowed be reordered. Any memory barrier must be explicitly created.</description>
		<content:encoded><![CDATA[<p>Your article states that for .NET, `volatile` operations cannot be reordered (implies a memory barrier) . However, according to the following article (and various other resources I&#8217;ve encountered on the web):</p>
<p><a href="http://msdn.microsoft.com/en-us/magazine/cc817398.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/magazine/cc817398.aspx</a></p>
<p>operations are allowed be reordered. Any memory barrier must be explicitly created.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Pierre Phaneuf</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1374</link>
		<dc:creator>Pierre Phaneuf</dc:creator>
		<pubDate>Mon, 20 Jul 2009 01:15:48 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1374</guid>
		<description>I wonder why there is so much &quot;volatile&quot; peppered all over the atomic functions on Windows and Mac OS X (the GCC built-ins do not, as I would expect)?</description>
		<content:encoded><![CDATA[<p>I wonder why there is so much &#8220;volatile&#8221; peppered all over the atomic functions on Windows and Mac OS X (the GCC built-ins do not, as I would expect)?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Herb Sutter</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1118</link>
		<dc:creator>Herb Sutter</dc:creator>
		<pubDate>Mon, 02 Mar 2009 19:23:41 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1118</guid>
		<description>Norbert asked:

&lt;blockquote&gt;
in your article you mention “volatile atomic” as a way to make a variable of being both, of unusual type (volatile) and to guarantee its atomicity.
What would be the difference to “atomic”?
&lt;/blockquote&gt;

A variable declared C++0x &quot;volatile atomic&quot; will have the union of the guarantees (and restrictions) of &quot;C/C++ volatile&quot; andstd:: &quot;atomic&quot;. It will be suitable for both inter-thread communication and communication with threads or hardware that don&#039;t follow the memory model. It&#039;s unusual to need that in practice, as you usually use one control variable to synchronize among your own threads, where atomic is the right tool, and another kind of variable to talk to hardware or otherwise unusual memory, where volatile is the right tool. Still, they&#039;re orthogonal concepts and if you do want both C++0x will let you express it.</description>
		<content:encoded><![CDATA[<p>Norbert asked:</p>
<blockquote><p>
in your article you mention “volatile atomic” as a way to make a variable of being both, of unusual type (volatile) and to guarantee its atomicity.<br />
What would be the difference to “atomic”?
</p></blockquote>
<p>A variable declared C++0x &#8220;volatile atomic&#8221; will have the union of the guarantees (and restrictions) of &#8220;C/C++ volatile&#8221; andstd:: &#8220;atomic&#8221;. It will be suitable for both inter-thread communication and communication with threads or hardware that don&#8217;t follow the memory model. It&#8217;s unusual to need that in practice, as you usually use one control variable to synchronize among your own threads, where atomic is the right tool, and another kind of variable to talk to hardware or otherwise unusual memory, where volatile is the right tool. Still, they&#8217;re orthogonal concepts and if you do want both C++0x will let you express it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Norbert Riedlin</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1084</link>
		<dc:creator>Norbert Riedlin</dc:creator>
		<pubDate>Mon, 09 Feb 2009 10:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1084</guid>
		<description>Hm, seem as if I have to type &quot;&lt;&quot; when I need a &quot;less than&quot; character. So I&#039;ll try again:
“What would be the difference to “atomic &lt;volatile T&gt;”?”</description>
		<content:encoded><![CDATA[<p>Hm, seem as if I have to type &#8220;&lt;&#8221; when I need a &#8220;less than&#8221; character. So I&#8217;ll try again:<br />
“What would be the difference to “atomic &lt;volatile T&gt;”?”</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Norbert Riedlin</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1078</link>
		<dc:creator>Norbert Riedlin</dc:creator>
		<pubDate>Fri, 06 Feb 2009 11:18:35 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1078</guid>
		<description>Sorry, hit the submit button too early. The question should read:
&quot;What would be the difference to “atomic”?&quot;</description>
		<content:encoded><![CDATA[<p>Sorry, hit the submit button too early. The question should read:<br />
&#8220;What would be the difference to “atomic”?&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Norbert Riedlin</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1077</link>
		<dc:creator>Norbert Riedlin</dc:creator>
		<pubDate>Fri, 06 Feb 2009 08:23:38 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1077</guid>
		<description>Hi Herb,

in your article you mention &quot;volatile atomic&quot; as a way to make a variable of being both, of unusual type (volatile) and to guarantee its atomicity.
What would be the difference to &quot;atomic&quot;?</description>
		<content:encoded><![CDATA[<p>Hi Herb,</p>
<p>in your article you mention &#8220;volatile atomic&#8221; as a way to make a variable of being both, of unusual type (volatile) and to guarantee its atomicity.<br />
What would be the difference to &#8220;atomic&#8221;?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Marco Dalla Gasperina</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1051</link>
		<dc:creator>Marco Dalla Gasperina</dc:creator>
		<pubDate>Wed, 21 Jan 2009 14:58:06 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1051</guid>
		<description>&quot;volatile&quot; doesn&#039;t require hardware registers or address multiplexing to be necessary.  Common APIs like shared memory between processes can fit the bill as well.</description>
		<content:encoded><![CDATA[<p>&#8220;volatile&#8221; doesn&#8217;t require hardware registers or address multiplexing to be necessary.  Common APIs like shared memory between processes can fit the bill as well.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kimo Crossman</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1041</link>
		<dc:creator>Kimo Crossman</dc:creator>
		<pubDate>Sat, 17 Jan 2009 17:49:34 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1041</guid>
		<description>Herb

Will you be commenting on the multicores advantages stop at about 8 study from US Gov. Sandia and Oak Ridge labs:

http://www.theregister.co.uk/2009/01/15/sandia_boffins_multicore_dropoff/</description>
		<content:encoded><![CDATA[<p>Herb</p>
<p>Will you be commenting on the multicores advantages stop at about 8 study from US Gov. Sandia and Oak Ridge labs:</p>
<p><a href="http://www.theregister.co.uk/2009/01/15/sandia_boffins_multicore_dropoff/" rel="nofollow">http://www.theregister.co.uk/2009/01/15/sandia_boffins_multicore_dropoff/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Herb Sutter</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1022</link>
		<dc:creator>Herb Sutter</dc:creator>
		<pubDate>Tue, 13 Jan 2009 17:41:14 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1022</guid>
		<description>Nick: Yes, the issues apply in principle to uniprocessor systems too. Think of it this way: Any level of the execution chain, from compiler to processor to cache (to future transactional memory in SW or HW to anything else) can transform reads and writes and must play nice with the memory model. On a uniproc system, you eliminate only processor and probably cache from that list, but the remaining parts (e.g., the compiler) can still perform unwanted transformations.

Roger: Yes, that&#039;s another valid example. The list wasn&#039;t meant to be exhaustive, just to give a few common examples to motivate why this is a legitimate issue. Another one I mentioned in the table but not in the text is setjmp-safety; there are more.</description>
		<content:encoded><![CDATA[<p>Nick: Yes, the issues apply in principle to uniprocessor systems too. Think of it this way: Any level of the execution chain, from compiler to processor to cache (to future transactional memory in SW or HW to anything else) can transform reads and writes and must play nice with the memory model. On a uniproc system, you eliminate only processor and probably cache from that list, but the remaining parts (e.g., the compiler) can still perform unwanted transformations.</p>
<p>Roger: Yes, that&#8217;s another valid example. The list wasn&#8217;t meant to be exhaustive, just to give a few common examples to motivate why this is a legitimate issue. Another one I mentioned in the table but not in the text is setjmp-safety; there are more.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roger Gammans</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1021</link>
		<dc:creator>Roger Gammans</dc:creator>
		<pubDate>Tue, 13 Jan 2009 12:59:09 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1021</guid>
		<description>Re C++ style, volatile.

When I was doing a lot of hardware engineering once of the classic hardware semantics was reading from a register to trigger an event. 
You don&#039;t mention this in your classic examples list , is this because it is not safe to assume the compiler won&#039;t add additional reads of a volatile register to the code?</description>
		<content:encoded><![CDATA[<p>Re C++ style, volatile.</p>
<p>When I was doing a lot of hardware engineering once of the classic hardware semantics was reading from a register to trigger an event.<br />
You don&#8217;t mention this in your classic examples list , is this because it is not safe to assume the compiler won&#8217;t add additional reads of a volatile register to the code?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nick Terry</title>
		<link>http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1020</link>
		<dc:creator>Nick Terry</dc:creator>
		<pubDate>Mon, 12 Jan 2009 18:53:21 +0000</pubDate>
		<guid isPermaLink="false">http://herbsutter.wordpress.com/2009/01/12/effective-concurrency-volatile-vs-volatile/#comment-1020</guid>
		<description>The articles on Lock-free programming have been immensely useful even from the lock based concurrency perspective.

I have a question hoping you have some insight.  Do these issues you&#039;ve described with lock-free programming exist on uniprocessor systems?

In particular I am interested problems arising from processor or cache memory reordering.  The assembly can always  be inspected to verify that compiler hasn&#039;t produced non-thread-safe code.</description>
		<content:encoded><![CDATA[<p>The articles on Lock-free programming have been immensely useful even from the lock based concurrency perspective.</p>
<p>I have a question hoping you have some insight.  Do these issues you&#8217;ve described with lock-free programming exist on uniprocessor systems?</p>
<p>In particular I am interested problems arising from processor or cache memory reordering.  The assembly can always  be inspected to verify that compiler hasn&#8217;t produced non-thread-safe code.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
