<?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: Barrier</title>
	<atom:link href="http://ridiculousfish.com/blog/archives/2007/02/17/barrier/feed/" rel="self" type="application/rss+xml" />
	<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/</link>
	<description>serious code</description>
	<lastBuildDate>Tue, 09 Mar 2010 16:09:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dina</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-910</link>
		<dc:creator>dina</dc:creator>
		<pubDate>Tue, 26 Jan 2010 20:10:43 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-910</guid>
		<description>Thanks for this great post. I have been debugging code on multiple platforms and very often need to know what processor is used in the specific platform and what memory synchronizations are missing on that platform(since the bugs are usually caused when the programmer forgets to explicitly add barriers that are not implemented on the platform). Here is the small list I have and would love it if people can add to it:
1. x86, x86-64 : strongly ordered
2. SPARC : Writes are not ordered with respect to reads and writes. 
3. Itanium : Writes are not ordered. Reads (?)
4. HPUX : ?</description>
		<content:encoded><![CDATA[<p>Thanks for this great post. I have been debugging code on multiple platforms and very often need to know what processor is used in the specific platform and what memory synchronizations are missing on that platform(since the bugs are usually caused when the programmer forgets to explicitly add barriers that are not implemented on the platform). Here is the small list I have and would love it if people can add to it:<br />
1. x86, x86-64 : strongly ordered<br />
2. SPARC : Writes are not ordered with respect to reads and writes.<br />
3. Itanium : Writes are not ordered. Reads (?)<br />
4. HPUX : ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Nat!</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-818</link>
		<dc:creator>Nat!</dc:creator>
		<pubDate>Wed, 29 Jul 2009 12:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-818</guid>
		<description>lwsync ? Wasn&#039;t that called isync once ? :)

I thought that an UNLOCK would imply a sync and that therefore the memory barrier would be redundant ? At least that&#039;s how I implemented it (isync in lock, sync in unlock).</description>
		<content:encoded><![CDATA[<p>lwsync ? Wasn&#8217;t that called isync once ? <img src='http://ridiculousfish.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I thought that an UNLOCK would imply a sync and that therefore the memory barrier would be redundant ? At least that&#8217;s how I implemented it (isync in lock, sync in unlock).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Friskywitz</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-743</link>
		<dc:creator>Friskywitz</dc:creator>
		<pubDate>Mon, 11 Jun 2007 00:59:18 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-743</guid>
		<description>I got asked several questions pertaining to this exact subject on my third phone interview from Apple Computers.

I said mutex... and should have read this blog first. D&#039;oh!</description>
		<content:encoded><![CDATA[<p>I got asked several questions pertaining to this exact subject on my third phone interview from Apple Computers.</p>
<p>I said mutex&#8230; and should have read this blog first. D&#8217;oh!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David Casseres</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-741</link>
		<dc:creator>David Casseres</dc:creator>
		<pubDate>Tue, 13 Mar 2007 04:13:44 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-741</guid>
		<description>Helluva post, Fish.  Thanks.</description>
		<content:encoded><![CDATA[<p>Helluva post, Fish.  Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tomsci</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-740</link>
		<dc:creator>tomsci</dc:creator>
		<pubDate>Thu, 01 Mar 2007 22:14:29 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-740</guid>
		<description>Cripes, I&#039;m a bit concerned this is the first I recall hearing about memory barriers! I (thought I) knew about out-of-order execution, but the multithreaded implications of that had escaped me.

V interesting post, this is something I&#039;ll file under the category of &quot;Things I hope I never need to use but if I do I now know to go and look it up before even attempting it myself&quot;</description>
		<content:encoded><![CDATA[<p>Cripes, I&#8217;m a bit concerned this is the first I recall hearing about memory barriers! I (thought I) knew about out-of-order execution, but the multithreaded implications of that had escaped me.</p>
<p>V interesting post, this is something I&#8217;ll file under the category of &#8220;Things I hope I never need to use but if I do I now know to go and look it up before even attempting it myself&#8221;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Asko Kauppi</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-739</link>
		<dc:creator>Asko Kauppi</dc:creator>
		<pubDate>Mon, 26 Feb 2007 20:18:56 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-739</guid>
		<description>Having seen the Lua and Io comments, I&#039;ll add to the queue of comments.

Lua does not --as of its standard libraries-- take a stand on how multithreading be made. Coroutines it offers are essentially within-the thread elements, and useful as such.

But with a small addon module to allow chunks of code &#039;thrown&#039; to other Lua states, I can see the language scale easily to 1000s of cores, if so wanted. This development is surely favourable to small footprint languages such as it.

Anyone wanting to have a go at N core Lua, send me a line. :)</description>
		<content:encoded><![CDATA[<p>Having seen the Lua and Io comments, I&#8217;ll add to the queue of comments.</p>
<p>Lua does not &#8211;as of its standard libraries&#8211; take a stand on how multithreading be made. Coroutines it offers are essentially within-the thread elements, and useful as such.</p>
<p>But with a small addon module to allow chunks of code &#8216;thrown&#8217; to other Lua states, I can see the language scale easily to 1000s of cores, if so wanted. This development is surely favourable to small footprint languages such as it.</p>
<p>Anyone wanting to have a go at N core Lua, send me a line. <img src='http://ridiculousfish.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John D.</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-738</link>
		<dc:creator>John D.</dc:creator>
		<pubDate>Mon, 26 Feb 2007 15:45:48 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-738</guid>
		<description>How about an efficient thread safe static initialization? Would this make a difference?

http://avitzur.hax.com/2006/11/efficient_thread_safe_static_i.html</description>
		<content:encoded><![CDATA[<p>How about an efficient thread safe static initialization? Would this make a difference?</p>
<p><a href="http://avitzur.hax.com/2006/11/efficient_thread_safe_static_i.html" rel="nofollow">http://avitzur.hax.com/2006/11/efficient_thread_safe_static_i.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sam</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-737</link>
		<dc:creator>Sam</dc:creator>
		<pubDate>Thu, 22 Feb 2007 19:58:07 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-737</guid>
		<description>alex.r.

Fair enough, you can actually replace the need for  lazy instanciation, still better than a double-checked lock.</description>
		<content:encoded><![CDATA[<p>alex.r.</p>
<p>Fair enough, you can actually replace the need for  lazy instanciation, still better than a double-checked lock.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: alex.r.</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-736</link>
		<dc:creator>alex.r.</dc:creator>
		<pubDate>Thu, 22 Feb 2007 02:19:37 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-736</guid>
		<description>Sam:
That implementation may be correct but it is slow, because you are required to acquire a lock for every call to getInstance().

This is useless once the first call has been completed. Let&#039;s pretend Thread 1 and 2 execute in parallel but Thread 1 calls getInstance() right before Thread 2:
Thread 1 : getInstance() : acquires Lock
Thread 2 : getInstance() : waits for lock

If the singleton variable is not null, Thread 1 won&#039;t modify it so there&#039;s no reason for Thread 2 to wait before entering the method.

The &quot;double read&quot; combined with &quot;volatile&quot; makes sure we only get the lock when we actually need it. Locking is an expansive thing to do for no reason.</description>
		<content:encoded><![CDATA[<p>Sam:<br />
That implementation may be correct but it is slow, because you are required to acquire a lock for every call to getInstance().</p>
<p>This is useless once the first call has been completed. Let&#8217;s pretend Thread 1 and 2 execute in parallel but Thread 1 calls getInstance() right before Thread 2:<br />
Thread 1 : getInstance() : acquires Lock<br />
Thread 2 : getInstance() : waits for lock</p>
<p>If the singleton variable is not null, Thread 1 won&#8217;t modify it so there&#8217;s no reason for Thread 2 to wait before entering the method.</p>
<p>The &#8220;double read&#8221; combined with &#8220;volatile&#8221; makes sure we only get the lock when we actually need it. Locking is an expansive thing to do for no reason.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Phil</title>
		<link>http://ridiculousfish.com/blog/archives/2007/02/17/barrier/comment-page-1/#comment-735</link>
		<dc:creator>Phil</dc:creator>
		<pubDate>Wed, 21 Feb 2007 13:02:57 +0000</pubDate>
		<guid isPermaLink="false">http://ridiculousfish.com/blog/archives/2007/02/17/barrier/#comment-735</guid>
		<description>Just for the record:

Can Programming Be Liberated from the von Neumann Style?

http://www.stanford.edu/class/cs242/readings/backus.pdf</description>
		<content:encoded><![CDATA[<p>Just for the record:</p>
<p>Can Programming Be Liberated from the von Neumann Style?</p>
<p><a href="http://www.stanford.edu/class/cs242/readings/backus.pdf" rel="nofollow">http://www.stanford.edu/class/cs242/readings/backus.pdf</a></p>
]]></content:encoded>
	</item>
</channel>
</rss>
