<?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:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Flirting With Models &#187; distributed</title>
	<atom:link href="http://coreyhoffstein.com/tag/distributed/feed/" rel="self" type="application/rss+xml" />
	<link>http://coreyhoffstein.com</link>
	<description>musings on numerical computing and financial modeling</description>
	<lastBuildDate>Mon, 30 Aug 2010 21:53:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Curtain Call for Ruby</title>
		<link>http://coreyhoffstein.com/2009/08/04/curtain-call-for-ruby/</link>
		<comments>http://coreyhoffstein.com/2009/08/04/curtain-call-for-ruby/#comments</comments>
		<pubDate>Tue, 04 Aug 2009 12:43:00 +0000</pubDate>
		<dc:creator>Corey</dc:creator>
				<category><![CDATA[programming]]></category>
		<category><![CDATA[actor]]></category>
		<category><![CDATA[curtaincall]]></category>
		<category><![CDATA[distributed]]></category>
		<category><![CDATA[journeta]]></category>
		<category><![CDATA[revactor]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://coreyhoffstein.com/?p=166</guid>
		<description><![CDATA[Unless you have been living under a rock, or don&#8217;t program, you know that the software world has been abuzz about the end of &#8220;free lunch&#8221; &#8212; i.e. we can no longer just toss &#8220;more horsepower&#8221; at our problems, in a traditional manner, and expect a speed-up to occur. Instead, we have to go parallel. [...]]]></description>
			<content:encoded><![CDATA[<p>Unless you have been living under a rock, or don&#8217;t program, you know that the software world has been abuzz about the end of &#8220;free lunch&#8221; &#8212; i.e. we can no longer just toss &#8220;more horsepower&#8221; at our problems, in a traditional manner, and expect a speed-up to occur.  Instead, we have to go parallel.  One of the most successful ways in doing this is by using the Actor pattern, exemplified in Erlang, which has been known to have 99.99999% up-times in real-world applications.</p>
<p>Being a fan of Ruby, I wanted to see if anyone had implemented the Actor pattern yet.  It wasn&#8217;t a hard concept &#8212; you just provide the class with a mail-box and a way to check and parse messages.  The issue falls in Ruby&#8217;s threads &#8212; namely, they are big and bulky.  To have lots of actors, we need a light-weight implementation.  What is worse is that Ruby suffers the same problem as Python when it comes to concurrency &#8212; the global interpreter lock (GIL) prevents the virtual machine from executing more than one instruction at a time.  So even though you might be running separate OS threads on multiple cores, the speed is limited by a single core.  So basically, using 1.8, the Actor pattern is a waste of time.</p>
<p>The stable release of Ruby 1.9 seems to tackle the issue head on, by providing Fibers.  With 1.9, I was able to find the (now defunct) revactor gem, which seemed like a fairly good (though poorly documented) implementation of the Actor pattern.  I also found journeta (which works on 1.8), which was a system that performed network auto-discovery.  With the power of these two combined, and some horrible spaghetti code, I whipped together a little gem called &#8216;curtaincall&#8217;, which allows end-users to spawn actors on other machines.  </p>
<p>Unfortunately, not everything turned out as well as I would have liked.  Revactor seems to break down &#8230; or at least, its dependency Rev does, in signaling the mailbox that it has a new message.  I can&#8217;t quite seem to figure out why this occurs, so as it stands, curtaincall actors never end up receiving the messages passed to them.  Furthermore, the method I used of identifying actors is horrible &#8212; though it gets the job done.  Finally, Erlang niceties like &#8216;spawn_link&#8217; are poorly implemented and untested.</p>
<p>Ultimately, once I hit the road-block with Revactor, I just gave up.  Revactor is undocumented and discontinued.  I just wanted to see if I could do this for fun.</p>
<p>The pros?  Journeta is a delight to work with.  Easy to figure out from the examples provided, and it works just as promised out of the box.  </p>
<p>Cons?  Just about everything else.</p>
<p><a href='http://coreyhoffstein.com/wp-content/uploads/2009/08/curtaincall-0.0.1.gem'>curtaincall-0.0.1</a></p>
<p><a class="a2a_dd addtoany_share_save" href="http://www.addtoany.com/share_save"><img src="http://coreyhoffstein.com/wp-content/plugins/add-to-any/share_save_171_16.png" width="171" height="16" alt="Share/Bookmark"/></a> </p>]]></content:encoded>
			<wfw:commentRss>http://coreyhoffstein.com/2009/08/04/curtain-call-for-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
