<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Yeoldeclue</title>
      <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi</link>
      <description>Random musings on random stuff...</description>
      <language>en-uk</language>
      <pubDate> Sun, 21 Jun 2009 15:15:00 +0000 </pubDate>
      <lastBuildDate> Sun, 21 Jun 2009 15:15:00 +0000 </lastBuildDate>
      <docs>http://blogs.law.harvard.edu/tech/rss</docs>
      <generator>Kamaelia 0.1</generator>
      <managingEditor>ms@cerenity.org</managingEditor>
      <webMaster>ms@cerenity.org</webMaster>
      <item>
         <title>Autoloading in python</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1245597300</link>
         <author>Michael</author>
         <description><![CDATA[Before I started using python, I'd used perl for several years, and one thing which I'd liked about perl was its <a href="http://perldoc.perl.org/perltoot.html#AUTOLOAD%3a-Proxy-Methods">autoload</a> facility. Now in python the closest equivalent that I've seen is __getattr__ for classes, but not __getattr__ for a module. This seemed like a real shame since there are times when autoload can be incredibly useful.<br>If it seems chaotic, consider the Unix PATH variable. Any time you type a name, the shell looks in lots of locations and runs the first one it finds. That's effectively the same sort of idea as autoloading. Yes, you can do some really nasty magic if you want, but then you can do that with the shell to, and generally people get along find.<br>Anyway, vaguely curious about it I decided to do some digging around, and came across <a href="http://mail.python.org/pipermail/python-list/2007-January/594272.html">this post</a> by Leif K Brookes, which suggests this:<br><blockquote>You could wrap it in an object, but that's a bit of a hack.<br>]]></description>
         <pubDate>Sun, 21 Jun 2009 15:15:00 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1245597300</guid>
      </item>
      <item>
         <title>Europython </title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1244651747</link>
         <author>Michael</author>
         <description><![CDATA[&nbsp;I've mentioned this in a couple of places, but mentioning on my blog seems appropriate too.<br>]]></description>
         <pubDate>Wed, 10 Jun 2009 16:35:47 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1244651747</guid>
      </item>
      <item>
         <title>New Tool for helping debugging Kamaelia Systems</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1244481479</link>
         <author>Michael</author>
         <description><![CDATA[I've added a PythonInterpreter component to Kamaelia in Kamaelia.Experimental.PythonInterpreter. The primary use for this is intended to assist with debugging, but there are other possible uses.<br><h4>Use in a system</h4>This allows a variety of things, from a basic command line console:<br><blockquote><font face="Courier New, monospace">StandaloneInterpreter().run()</font><br></blockquote>Which you can run in the background on any console. For example you could do <br>this:<br><blockquote><font face="Courier New, monospace">&nbsp; &nbsp; ServerCore(protocol=myprotocol, port=1234).activate()<br>&nbsp; &nbsp; StandaloneInterpreter().run()<br></font></blockquote>Alternatively, you can use an embeddable component that speaks to inbox/outbox rather than stdin/stdout. Crudely you can do something like this:<br><blockquote><font face="Courier New, monospace">&nbsp; &nbsp; Pipeline(</font><br><font face="Courier New, monospace">&nbsp; &nbsp; &nbsp; &nbsp; ConsoleReader(),</font><br><font face="Courier New, monospace">&nbsp; &nbsp; &nbsp; &nbsp; InterpreterTransformer(),</font><br><font face="Courier New, monospace">&nbsp; &nbsp; &nbsp; &nbsp; ConsoleEchoer(),</font><br><font face="Courier New, monospace">&nbsp; &nbsp; ).run()</font><br></blockquote>But you can also put it inside a pygame application, reading &amp; writing from a <br>Textbox/TextDisplayer:<br>&nbsp; &nbsp; Pipeline(<br>&nbsp; &nbsp; &nbsp; &nbsp; Textbox(size = (800, 300), position = (100,380)),<br>&nbsp; &nbsp; &nbsp; &nbsp; InterpreterTransformer(),<br>&nbsp; &nbsp; &nbsp; &nbsp; TextDisplayer(size = (800, 300), position = (100,40)),<br>&nbsp; &nbsp; ).run()<br>]]></description>
         <pubDate>Mon, 08 Jun 2009 17:17:59 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1244481479</guid>
      </item>
      <item>
         <title>Going from generator coroutines to Kamaelia Components</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1242522657</link>
         <author>Michael</author>
         <description><![CDATA[Earlier this evening an <a href="http://groups.google.com/group/unladen-swallow/browse_thread/thread/e2c2f9fd61041f0">announcement by Pete Fein</a> regarding the formation of a <a href="http://groups.google.com/group/python-concurrency">python-concurrency</a> mailing list (aka Python Concurrency Special Interest Group) bounced past my inbox in the <a href="http://groups.google.com/group/unladen-swallow">unladen-swallow</a> mailing list. Naturally, given my work on <a href="http://www.kamaelia.org/Docs/Axon/Axon">Axon</a> (a concurrency library) and <a href="http://www.kamaelia.org/Home">Kamaelia</a> (a bunch of components that use it), it jumped out at me as interesting. (<a href="http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1235690128">5 minute overview</a> for those that don't know what Kamaelia is...)<br>]]></description>
         <pubDate>Sun, 17 May 2009 01:10:56 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1242522657</guid>
      </item>
      <item>
         <title>Bar Camp Leeds UK</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1241557002</link>
         <author>Michael</author>
         <description><![CDATA[Bar Camp Leeds (UK) is running for its 3rd year running. It'd be great to see other Python people there if you're around. Details:<br><ul><li>May 30th, May 31st</li><li>Old Broadcasting House, Leeds, UK</li><li>Website: <a href="http://barcampleeds.com/">http://barcampleeds.com/</a></li></ul><br>]]></description>
         <pubDate>Tue, 05 May 2009 20:56:42 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1241557002</guid>
      </item>
      <item>
         <title>Schedulers matter</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1236162413</link>
         <author>Michael</author>
         <description><![CDATA[Improving the scheduler. It's been something we've avoided for quite a while in Kamaelia, but <a href="http://entitycrisis.blogspot.com/">Simon Wittber</a>'s recent post benchmarking <a href="http://code.google.com/p/fibra/">Fibra</a> vs <a href="http://www.stackless.com/">Kamaelia</a> vs <a href="http://www.stackless.com/">stackless</a> is interesting. His key showing that "Stackless is 7x faster than Fibra, and Fibra is 10x faster than Kamaelia" are cool for him :-) ... and naturally led me to think "why". Looking at the code, it struck me that he's doing something more interesting with the scheduler given these code forms:<br><blockquote><font face="Courier New, monospace">scheduler.install(self.messageLoop()) <br><i><font face="Arial, Helvetica, sans-serif"># self.MessageLoop is a regular python generator</font></i><br>...<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yield self.incrementCounter()<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; yield kickTo.messageQueue.push(self)<br></font></blockquote>If you delve inside the fibra scheduler (which doesn't appear to be <a href="http://code.google.com/p/fibra/source/browse">here</a> unexpectedly) you see the following core:<br><blockquote><font face="Courier New, monospace">&nbsp;&nbsp;&nbsp; <b>def</b> tick(self):<br><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; """Iterates the scheduler, running all tasks and calling all<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handlers.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; """<br></i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; active = False<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>for</b> handler <b>in</b> self.handlers:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; active = handler.is_waiting() <b>or</b> active<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; active = (len(self.tasks) &gt; 0) <b>or</b> active<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tasks = []<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>while</b> True:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>try</b>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; task, send_value = self.tasks.pop(0)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>except</b> IndexError, e:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>break</b><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>try</b>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>if</b> isinstance(send_value, Exception):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = task.throw(send_value)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>else</b>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = task.send(send_value)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>except</b> StopIteration, e:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; r = e<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>if</b> r <b>is</b> None:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tasks.append((task, None))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>else</b>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>try</b>:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler = self.type_handlers[type(r)]<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>except</b> KeyError:<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>raise</b> RuntimeError("Don't know what to do with yielded type: %s" % type(r))<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handler.handle(r, task)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.tasks[:] = tasks<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>return</b> active<br></font></blockquote>The core of this appears to be "when I'm done, do this later" next. If you think that's familiar, it should be - its very <i>similar</i> (at least conceptually) to what twisted does with deferreds. It's not identical, but similar. So what does this mean for the hacksack demo? Well, if we look at self.tasks after each run, by changing:<br><blockquote><font face="Courier New, monospace">&nbsp;&nbsp;&nbsp; <b>def</b> run(self):</font><br><font face="Courier New, monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>while</b> self.tick():</font><br><font face="Courier New, monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>pass</b></font><br></blockquote>to:<br><blockquote><font face="Courier New, monospace">&nbsp;&nbsp;&nbsp; <b>def</b> run(self):</font><br><font face="Courier New, monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>while</b> self.tick():</font><br><font face="Courier New, monospace">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <b>print</b> "TASKS", [x[0] <b>for</b> x <b>in</b> self.tasks]</font><br></blockquote>It becomes apparent what's happening (though it's fairly obvious from above):<br><blockquote><font face="Courier New, monospace">TASKS [&lt;generator object at 0xb7b04fcc&gt;]<br>TASKS []<br>TASKS [&lt;generator object at 0xb780f94c&gt;]<br>TASKS []<br>TASKS [&lt;generator object at 0xb7a1b04c&gt;]<br>TASKS []<br>TASKS [&lt;generator object at 0xb776fcac&gt;]<br>TASKS []<br>TASKS [&lt;generator object at 0xb79327ac&gt;]<br>TASKS []<br>TASKS [&lt;generator object at 0xb7b0ff2c&gt;]<br>TASKS []<br></font></blockquote>Fundamentally, the reason it's quicker for two reasons:<br><ul><li>It always knows which generator is ready to run next.</li><li>It also defaults to pausing the generator, unless it specifically asks to be run. ie the tasks default to being passive.</li><li>The sender knows who the receiver is. This allows the sender to schedule the receiver explicitly.</li></ul>These two points matter because Axon's scheduler (from jesse's post, hopefully people are aware that Axon is the relevant part of kamaelia here):<br><ul><li>Is effectively a round robin scheduler - essentially for simplicity. The key question we wanted to ask was <i>"does a component model based around inboxes/outboxes make it easier to make easier to write/reuse concurrent software", rather than "how can we build a faster, more responsive scheduler"</i>. As a result the round robin scheduler was always a compromise. There's a <i>little</i> bit of intelligence in there, but not much.<br></li><li>Kamaelia's components default to active, rather than passive. That is they're expected to run continuously unless explicitly paused. This design decision impacts the scheduler as a whole.</li><li>The sender does <b>not</b> know who the receiver is. This requires something different to happen in the scheduler. On the upside, it means that code can be tested easier in isolation, or reused in situations it wasn't originally expected to be used within.<br></li></ul>This leads me to the rather obvious solution here - can we rebuild a better Axon scheduler by reusing fibra and throw away our scheduler? If so that would be really neat - throwing away our scheduler for something faster and more intelligent would be rather fun :) If we can't then we've been pondering improving it - that is making it more intelligent - for a while. Fibra's benchmarks suggest that doing so would be well worth it. The question this raises though is whether doing this would help us in the general case. At present I'm unclear on that, but until you try, you don't know.<br>]]></description>
         <pubDate>Wed, 04 Mar 2009 10:26:54 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1236162413</guid>
      </item>
      <item>
         <title>The 5 minute (version), not the full half hour...</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1235690128</link>
         <author>Michael</author>
         <description><![CDATA[<P>As you may know <a href="http://www.kamaelia.org/Home">Kamaelia</a> is a project <a href="http://twitter.com/kamaelian">I'm</a> rather familar with (ok understatement), but one of the key ideas behind it is about how to make concurrency usable for everyday problems (from <a href="http://www.kamaelia.org/KamaeliaGrey">greylisting</a>, <a href="http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1195955570">database modelling assistance</a>, though to <a href="http://www.kamaelia.org/SpeakAndWrite">learning to read &amp; write</a>). No one concurrency method suits everyone - as <a href="http://jessenoller.com/">Jesse's</a> recent series of posts shows (if you've not read them they're well worth it :), but Kamaelia's approach fits my head, and hopefully yours too. There may be a few areas where nicer syntactic sugar may be appropriate and so on, and feedback is always welcome - preferably to the <a href="http://groups.google.com/group/kamaelia">project's google group/mailing list</a>.<P>OK, the point of this post is that recently at <a href="http://ignite.oreilly.com/uk-north/">O'Reilly Ignite UK North</a> I gave a 5 minute talk which was essentially "what we've learnt about practical concurrency", and by necessity of time it's a whistle stop tour. The slides are on <a href="http://www.slideshare.net/kamaelian/embracing-concurrency-for-fun-utility-and-simpler-code-presentation">slideshare</a>, and the video is on <a href="http://igniteuknorth.blip.tv/file/1815831/">blip.tv</a> - <a href="http://igniteuknorth.blip.tv/">along with the rest of the talks</a> - and by the magic of the internet they're below as well.<h3> Embracing Concurrency (slides) </h3><div style="width:425px;text-align:left" id="__ss_951612"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/kamaelian/embracing-concurrency-for-fun-utility-and-simpler-code-presentation?type=presentation" title="Embracing concurrency for fun utility and simpler code">Embracing concurrency for fun utility and simpler code</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=kamaeliaignite-1232909580582583-1&stripped_title=embracing-concurrency-for-fun-utility-and-simpler-code-presentation" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=kamaeliaignite-1232909580582583-1&stripped_title=embracing-concurrency-for-fun-utility-and-simpler-code-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">presentations</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/kamaelian">kamaelian</a>. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/concurrency">concurrency</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/multicore">multicore</a>)</div></div><h3> Embracing Concurrency (video) </h3><embed src="http://blip.tv/play/Ae+0dJSqMg" type="application/x-shockwave-flash" width="720" height="446" allowscriptaccess="always" allowfullscreen="true"></embed> ]]></description>
         <pubDate>Thu, 26 Feb 2009 23:15:28 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1235690128</guid>
      </item>
      <item>
         <title>Actor Model vs Denial of Service</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1226893221</link>
         <author>Michael</author>
         <description><![CDATA[Kamaelia implements something similar to, but not the same as the Actor Model. Since I'd not heard of the actor model for the majority of time whilst working on Kamaelia (kamaelia is more like occam, unix pipes, hardware, etc), I've been reading up on it. One thing that I've come across about it that suprises me is this:<br><blockquote><i>Communications among actors occur asynchronously: that is, the sendingactor does not wait until the message is received before proceedingwith computation.</i><br>(this summary courtesy of the Wikipedia page on the <a href="http://en.wikipedia.org/wiki/Actor_model">Actor Model</a>, but the literature supports this view as well)<br></blockquote>The difference between Kamaelia and the Actor Model is in a few places, but possibly the most fundamental is this:<br><ul><li>With the actor model (as I understand it)<br></li><ul><li>You have a mailbox where you receive messages. ("recv from inbox")</li><li>communications defaults to unidirectional, though you can build bi-directional</li></ul><ul><li><b>When you send a message, you know the recipient and send it direct to the recipient. ("send to bob")</b></li><li>Message sending is asynchronous<br></li><li><b>ie sender knows receiver</b>, receiver does not (necessarily) know sender<br></li><ul><li>This potentially introduces coupling in ways that makes co-ordination languages harder to build<br></li></ul></ul><li>With Kamaelia's model:<br></li><ul><li>You receive messages from multiple named inboxes (ala receiving data on stdin, or receiving signals)</li><li>communications defaults to unidirectional, though you can build bi-directional</li><li><b>You send messages to named outboxes (ala sending to stdout, stderr)</b></li><li>A higher level co-ordination language (effectively) joins the dots between outboxes to inboxes (generally)</li><li>Message sending <b>defaults</b> to asynchronous, but you can define a "pipewidth" or "max number of messages in transit" to allow synchrony, where needed (such as a producer that produces data faster than the consumer can consume it)<br></li><li><b>ie sender does NOT know receiver</b>, receiver does not (necessarily) know sender</li><ul><li>Much like a CPU doesn't know whether it's plugged into a motherboard or a testing harness for example.</li><li>This defaults to needing a co-ordination language - but this encourages greater reusability of components, through a dataflow model</li></ul><li>I say "kamaelia's" model here, but this is pretty similar to hardware, unix pipes, etc.<br></li></ul></ul>Now the thing I can't tell by looking at literature is what the general case is for most actor systems <i>in practice:</i><br><ul><li>Do they do the literal, and solely asynchronous thing? (ie always return immediately without error when you send a message)<br></li><li>Or do they introduce the ability to add in synchrony where necessary? (block or return an exception when a maximum inbox size is reached)<br></li></ul>The reason I ask is because if you don't have the ability to define pipewidths, maximum inbox sizes, maximum outbox sizes or <b>something</b> then you can easily cause a denial of service attack in that scenario by having producers overload consumers. Consider a frame grabber feeding a slow, experimental video codec. In that scenario, it becomes rather important to be able to have a form of blocking (or EAGAIN) behaviour available. Indeed, this is such a common issue, that it's why unix pipes &amp; filehandles will buffer a small amount of data, but block if you send too much data (or exhibit EAGAIN behaviour :). Similarly this is what's behind the socket.listen(argument) call in a server - to allow a certain number of connections to queue up, before refusing connections...<br>]]></description>
         <pubDate>Mon, 17 Nov 2008 03:40:21 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1226893221</guid>
      </item>
      <item>
         <title>Simple Chat Server in Kamaelia</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1226574014</link>
         <author>Michael</author>
         <description><![CDATA[On the #kamaelia <a href="http://www.kamaelia.org/irc">IRC channel</a> , the issue was raised that a number of the examples on the Kamaelia website are just that, small examples, perhaps too small to be useful beyond illustrating the basic idea. (I'm not sure this is universally true, but I accept its definitely the place in more places than we'd like!). Now, one thing we've got planned for the december release is to include a lot more examples, and as a result I'm interested in hearing what sort of examples people would find useful. For example, the example mentioned on the channel is "what does a simple chat server look like" ? (and hence why I'm interested in what examples people would find interesting/useful)<br>]]></description>
         <pubDate>Thu, 13 Nov 2008 11:00:14 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1226574014</guid>
      </item>
      <item>
         <title>A post per day in November</title>
         <link>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1225636751</link>
         <author>Michael</author>
         <description><![CDATA[Interesting new meme, I think I'll jump on this bandwagon. For my first post in this vein, I ought to retroactively do November 1st's post. So, in that spirit of catching up, I'll post the following short presentation I wrote to answer <a href="http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&nodeid=1223342651">a query posted on my blog</a> a few days ago. As it indicates, it's a walkthrough about what happens inside a particular, simplilfied layered protocol written in Kamaelia. It's probably worth noting that every "box" in the diagrams is a separate component, meaning it runs concurrently with other components.<br><div style="width:425px;text-align:left" id="__ss_709252"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/kamaelian/kamaelia-protocol-walkthrough-presentation?type=powerpoint" title="Kamaelia Protocol Walkthrough">Kamaelia Protocol Walkthrough</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slideshare.net/swf/ssplayer2.swf?doc=protocolwalkthrough-1225465527127302-9&stripped_title=kamaelia-protocol-walkthrough-presentation" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slideshare.net/swf/ssplayer2.swf?doc=protocolwalkthrough-1225465527127302-9&stripped_title=kamaelia-protocol-walkthrough-presentation" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View SlideShare <a style="text-decoration:underline;" href="http://www.slideshare.net/kamaelian/kamaelia-protocol-walkthrough-presentation?type=powerpoint" title="View Kamaelia Protocol Walkthrough on SlideShare">presentation</a> or <a style="text-decoration:underline;" href="http://www.slideshare.net/upload?type=powerpoint">Upload</a> your own. (tags: <a style="text-decoration:underline;" href="http://slideshare.net/tag/concurrency">concurrency</a> <a style="text-decoration:underline;" href="http://slideshare.net/tag/python">python</a>)</div></div><br>The reason for it being that form is because it is <i>significantly</i> clearer than text.<br>]]></description>
         <pubDate>Sun, 02 Nov 2008 14:39:11 +0000</pubDate>
         <guid>http://yeoldeclue.com/cgi-bin/blog/blog.cgi?rm=viewpost&amp;nodeid=1225636751</guid>
      </item>
   </channel>
</rss>

