<?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/"
		>
<channel>
	<title>Comments on: Coding Standard Rule #4: Use volatile Whenever Possible</title>
	<atom:link href="http://embeddedgurus.com/barr-code/2009/03/coding-standard-rule-4-use-volatile-whenever-possible/feed/" rel="self" type="application/rss+xml" />
	<link>http://embeddedgurus.com/barr-code/2009/03/coding-standard-rule-4-use-volatile-whenever-possible/</link>
	<description>A Blog by Michael Barr</description>
	<lastBuildDate>Fri, 18 May 2012 17:16:50 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: Luke Teyssier</title>
		<link>http://embeddedgurus.com/barr-code/2009/03/coding-standard-rule-4-use-volatile-whenever-possible/comment-page-1/#comment-67530</link>
		<dc:creator>Luke Teyssier</dc:creator>
		<pubDate>Tue, 24 Jan 2012 21:58:05 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/03/27/coding-standard-rule-4-use-volatile-whenever-possible/#comment-67530</guid>
		<description>I agree wholeheartedly with &quot;The volatile keyword shall be used whenever appropriate&quot;. I don&#039;t agree with &quot;Use volatile Whenever Possible&quot;. Volatile comes with a price. In many compilers it will defeat any attempt at optimization, pipelining, or out of order execution around that variable, and possibly for the entire block or function. It&#039;s important to know _exactly_ when volatile is required and use it _every_ time. If volatile is essential to the function of your program, you also need to spot-check the generated assembly at every optimization setting you are using to ensure that your compiler gets it right. Compiler errors here are more common than anyone would like to admit.

If you suspect a &quot;volatile&quot; problem, many compilers support an option like -fvolatile, which will treat all variables in a module as volatile. This will kill your performance, but at least it can help you track down the problem quickly.

Further, if you are working on a memory-mapped device, you _must_ ensure cache coherency. This is a major cause of race conditions in device drivers.

Thanks for the article.</description>
		<content:encoded><![CDATA[<p>I agree wholeheartedly with &#8220;The volatile keyword shall be used whenever appropriate&#8221;. I don&#8217;t agree with &#8220;Use volatile Whenever Possible&#8221;. Volatile comes with a price. In many compilers it will defeat any attempt at optimization, pipelining, or out of order execution around that variable, and possibly for the entire block or function. It&#8217;s important to know _exactly_ when volatile is required and use it _every_ time. If volatile is essential to the function of your program, you also need to spot-check the generated assembly at every optimization setting you are using to ensure that your compiler gets it right. Compiler errors here are more common than anyone would like to admit.</p>
<p>If you suspect a &#8220;volatile&#8221; problem, many compilers support an option like -fvolatile, which will treat all variables in a module as volatile. This will kill your performance, but at least it can help you track down the problem quickly.</p>
<p>Further, if you are working on a memory-mapped device, you _must_ ensure cache coherency. This is a major cause of race conditions in device drivers.</p>
<p>Thanks for the article.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Combining C&#8217;s volatile and const Keywords &#171; Barr Code</title>
		<link>http://embeddedgurus.com/barr-code/2009/03/coding-standard-rule-4-use-volatile-whenever-possible/comment-page-1/#comment-67451</link>
		<dc:creator>Combining C&#8217;s volatile and const Keywords &#171; Barr Code</dc:creator>
		<pubDate>Tue, 24 Jan 2012 11:29:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/03/27/coding-standard-rule-4-use-volatile-whenever-possible/#comment-67451</guid>
		<description>[...] Coding Standard Rule #4: Use volatile Whenever Possible for more on the use of volatile by [...]</description>
		<content:encoded><![CDATA[<p>[...] Coding Standard Rule #4: Use volatile Whenever Possible for more on the use of volatile by [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Combining C&#8217;s volatile and const Keywords &#171; Barr Code</title>
		<link>http://embeddedgurus.com/barr-code/2009/03/coding-standard-rule-4-use-volatile-whenever-possible/comment-page-1/#comment-67452</link>
		<dc:creator>Combining C&#8217;s volatile and const Keywords &#171; Barr Code</dc:creator>
		<pubDate>Tue, 24 Jan 2012 11:29:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/03/27/coding-standard-rule-4-use-volatile-whenever-possible/#comment-67452</guid>
		<description>[...] Coding Standard Rule #4: Use volatile Whenever Possible for more on the use of volatile by [...]</description>
		<content:encoded><![CDATA[<p>[...] Coding Standard Rule #4: Use volatile Whenever Possible for more on the use of volatile by [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik Shreve</title>
		<link>http://embeddedgurus.com/barr-code/2009/03/coding-standard-rule-4-use-volatile-whenever-possible/comment-page-1/#comment-42</link>
		<dc:creator>Erik Shreve</dc:creator>
		<pubDate>Fri, 27 Mar 2009 18:26:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfcdev.org/test-stack/2009/03/27/coding-standard-rule-4-use-volatile-whenever-possible/#comment-42</guid>
		<description>Michael,The following paper/website has some additional information about bugs surrounding the use of volatile:http://www.cs.utah.edu/~regehr/papers/emsoft08-preprint.pdfhttp://www.cs.utah.edu/~eeide/emsoft08/I&#039;ve recently heard (via a mailing list) that the authors have found several other compilers, beyond those in the paper, with the same issues.One of the takeaways from the paper is a decrease in error rate when volatile access is hidden behind helper function calls.Cheers!Erik Shreve</description>
		<content:encoded><![CDATA[<p>Michael,The following paper/website has some additional information about bugs surrounding the use of volatile:<a href="http://www.cs.utah.edu/~regehr/papers/emsoft08-preprint.pdfhttp://www.cs.utah.edu/~eeide/emsoft08/I&#039;ve" rel="nofollow">http://www.cs.utah.edu/~regehr/papers/emsoft08-preprint.pdfhttp://www.cs.utah.edu/~eeide/emsoft08/I&#039;ve</a> recently heard (via a mailing list) that the authors have found several other compilers, beyond those in the paper, with the same issues.One of the takeaways from the paper is a decrease in error rate when volatile access is hidden behind helper function calls.Cheers!Erik Shreve</p>
]]></content:encoded>
	</item>
</channel>
</rss>

