<?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: What is Erlang-Style Concurrency?</title>
	<atom:link href="http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/feed/" rel="self" type="application/rss+xml" />
	<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/</link>
	<description>CTO Erlang Solutions Ltd - @uwiger - ulf.wiger (at) erlang-solutions.com</description>
	<lastBuildDate>Mon, 08 Mar 2010 20:51:59 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Daily Links #98 &#124; CloudKnow</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17672</link>
		<dc:creator>Daily Links #98 &#124; CloudKnow</dc:creator>
		<pubDate>Tue, 15 Sep 2009 15:54:15 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17672</guid>
		<description>[...] Ulf Wiger: What is Erlang-Style Concurrency? [...]</description>
		<content:encoded><![CDATA[<p>[...] Ulf Wiger: What is Erlang-Style Concurrency? [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ulf Wiger</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17640</link>
		<dc:creator>Ulf Wiger</dc:creator>
		<pubDate>Mon, 14 Sep 2009 14:16:16 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17640</guid>
		<description>@YC, indeed, some languages have superb extension facilities (LISP and Haskell come to mind) and can provide almost anything as libraries on top of the core language. On the other hand, one really wants all libraries to use a common concurrency model, for example (or at the very least, compatible concurrency models), so even if these things are technically implemented as libraries, they really have a tendency to become part of an extended language definition, at least.

There are several concurrency models implemented on top of the JVM, for example, but their use is limited, partly because the vast majority of Java libraries assume the shared-object concurrency model provided by the core language.

Similarly, I&#039;ve witnessed C++ projects get into trouble because they changed the concurrency model and never got around to rewriting their old code, and ended up having to develop incompatible implementations of the same features for both models.</description>
		<content:encoded><![CDATA[<p>@YC, indeed, some languages have superb extension facilities (LISP and Haskell come to mind) and can provide almost anything as libraries on top of the core language. On the other hand, one really wants all libraries to use a common concurrency model, for example (or at the very least, compatible concurrency models), so even if these things are technically implemented as libraries, they really have a tendency to become part of an extended language definition, at least.</p>
<p>There are several concurrency models implemented on top of the JVM, for example, but their use is limited, partly because the vast majority of Java libraries assume the shared-object concurrency model provided by the core language.</p>
<p>Similarly, I&#8217;ve witnessed C++ projects get into trouble because they changed the concurrency model and never got around to rewriting their old code, and ended up having to develop incompatible implementations of the same features for both models.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ulf Wiger</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17638</link>
		<dc:creator>Ulf Wiger</dc:creator>
		<pubDate>Mon, 14 Sep 2009 13:40:59 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17638</guid>
		<description>@John, this very issue came up in the discussion about Tony Arcieri&#039;s blog post &quot;Single Assignment Myths&quot; (http://tonyarcieri.org/articles/2008/09/30/single-assignment-myths which is unavailable as I&#039;m writing this - hopefully not permanently). Reia is a Ruby-like language that runs on top of the Erlang VM. It supports Erlang-style concurrency, but does not have single assignment. It&#039;s perfectly reasonable to have destructive assignment combined with copying message passing, and I don&#039;t see that it would have to slow anything down.</description>
		<content:encoded><![CDATA[<p>@John, this very issue came up in the discussion about Tony Arcieri&#8217;s blog post &#8220;Single Assignment Myths&#8221; (<a href="http://tonyarcieri.org/articles/2008/09/30/single-assignment-myths" rel="nofollow">http://tonyarcieri.org/articles/2008/09/30/single-assignment-myths</a> which is unavailable as I&#8217;m writing this &#8211; hopefully not permanently). Reia is a Ruby-like language that runs on top of the Erlang VM. It supports Erlang-style concurrency, but does not have single assignment. It&#8217;s perfectly reasonable to have destructive assignment combined with copying message passing, and I don&#8217;t see that it would have to slow anything down.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: YC</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17636</link>
		<dc:creator>YC</dc:creator>
		<pubDate>Mon, 14 Sep 2009 10:31:53 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17636</guid>
		<description>Ulf - 

thanks for providing the checklist as it helps to establish the bar for other languages. 

I would say that not all of the checklist are *fundamental* to have in the core language *if* the language has good extension facility.  

The fundamental ones, i.e. difficult if not impossible to have at module level, are the microthreads and asynchronous message passing - the rest can be built as extensions. 

I have just built the selective reception capability as a module for PLT Scheme on top of its microthreads - http://weblambda.blogspot.com/2009/09/erlang-style-programming-in-plt.html - distributed message and process monitoring can also be added in due time (and necessary effort of course). 

It is true for other languages that cannot blur the line between the language and the extensions, the language provider would have to work harder to provide most if not all of the checklist.</description>
		<content:encoded><![CDATA[<p>Ulf &#8211; </p>
<p>thanks for providing the checklist as it helps to establish the bar for other languages. </p>
<p>I would say that not all of the checklist are *fundamental* to have in the core language *if* the language has good extension facility.  </p>
<p>The fundamental ones, i.e. difficult if not impossible to have at module level, are the microthreads and asynchronous message passing &#8211; the rest can be built as extensions. </p>
<p>I have just built the selective reception capability as a module for PLT Scheme on top of its microthreads &#8211; <a href="http://weblambda.blogspot.com/2009/09/erlang-style-programming-in-plt.html" rel="nofollow">http://weblambda.blogspot.com/2009/09/erlang-style-programming-in-plt.html</a> &#8211; distributed message and process monitoring can also be added in due time (and necessary effort of course). </p>
<p>It is true for other languages that cannot blur the line between the language and the extensions, the language provider would have to work harder to provide most if not all of the checklist.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John F. Miller</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17624</link>
		<dc:creator>John F. Miller</dc:creator>
		<pubDate>Mon, 14 Sep 2009 00:44:14 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17624</guid>
		<description>Ulf, I note that you made no mention of Erlang&#039;s insistence on single assignment.  Do you think that this is required to achieve efficient copying semantics?  Conversely, could a system that did not enforce single assignment be said to have Erlang-style concurrency?</description>
		<content:encoded><![CDATA[<p>Ulf, I note that you made no mention of Erlang&#8217;s insistence on single assignment.  Do you think that this is required to achieve efficient copying semantics?  Conversely, could a system that did not enforce single assignment be said to have Erlang-style concurrency?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ulf Wiger</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17610</link>
		<dc:creator>Ulf Wiger</dc:creator>
		<pubDate>Sun, 13 Sep 2009 15:11:44 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17610</guid>
		<description>@Jeremy, yes this was an important input requirement for Erlang - one shouldn&#039;t have to know the location of a process in order to talk to it, but if one does need to know, the information should be available. I tried to incorporate that by noting that &quot;Remote processes appear largely the same as local processes&quot;. The question is whether it should be viewed as a necessary for &quot;erlang-style concurrency&quot;? 

One counter-argument might be that distribution wasn&#039;t added to Erlang until 1993 - after the publication of the first Erlang book! (:

However, the idea of Distributed Erlang was there from the start, and the semantics of process spawning and message passing were created with distribution in mind.</description>
		<content:encoded><![CDATA[<p>@Jeremy, yes this was an important input requirement for Erlang &#8211; one shouldn&#8217;t have to know the location of a process in order to talk to it, but if one does need to know, the information should be available. I tried to incorporate that by noting that &#8220;Remote processes appear largely the same as local processes&#8221;. The question is whether it should be viewed as a necessary for &#8220;erlang-style concurrency&#8221;? </p>
<p>One counter-argument might be that distribution wasn&#8217;t added to Erlang until 1993 &#8211; after the publication of the first Erlang book! (:</p>
<p>However, the idea of Distributed Erlang was there from the start, and the semantics of process spawning and message passing were created with distribution in mind.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeremy Bowers</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17609</link>
		<dc:creator>Jeremy Bowers</dc:creator>
		<pubDate>Sun, 13 Sep 2009 14:52:20 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17609</guid>
		<description>I would also add &quot;processes can be messaged across system boundaries as easily as local processes&quot;. That&#039;s the big one that prevents me from using Haskell for things I currently use Erlang for; Haskell is arguably better on a single machine, especially for performance, but when you want to have high-availability, you&#039;re sort of stuck.</description>
		<content:encoded><![CDATA[<p>I would also add &#8220;processes can be messaged across system boundaries as easily as local processes&#8221;. That&#8217;s the big one that prevents me from using Haskell for things I currently use Erlang for; Haskell is arguably better on a single machine, especially for performance, but when you want to have high-availability, you&#8217;re sort of stuck.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dmitriy V'jukov</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17247</link>
		<dc:creator>Dmitriy V'jukov</dc:creator>
		<pubDate>Mon, 31 Aug 2009 12:52:12 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17247</guid>
		<description>Thank you, Ulf!</description>
		<content:encoded><![CDATA[<p>Thank you, Ulf!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ulf Wiger</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17184</link>
		<dc:creator>Ulf Wiger</dc:creator>
		<pubDate>Fri, 28 Aug 2009 22:41:36 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17184</guid>
		<description>@Dmitriy, simplifying a bit, message passing cost is on the order of a few (&lt; 5) microseconds + data copying cost. Now, with manycore systems, things are not so clear-cut. As you say, the more interesting figure is the cost of message send + contect switching and reception. As it happens, this is also easier to measure, and the traditional ring benchmark does this pretty well. On my old 400 MHz single-core UltraSPARC at work, this would cost ca 4 usec for a very small message.

Also, as you point out, process creation and teardown is the interesting bit in a dynamic system. As Erlang processes have separate heaps, terminating a process is basically a free() operation + possibly sending notifications to linked processes. 

In practice, this tends to mean that you can indeed spawn and kill a process in only a few microseconds on a modern machine. However, I haven&#039;t really attempted to obtain a precise number, and this is not entirely trivial either, since both process creation and process termination are asynchronous operations.</description>
		<content:encoded><![CDATA[<p>@Dmitriy, simplifying a bit, message passing cost is on the order of a few (< 5) microseconds + data copying cost. Now, with manycore systems, things are not so clear-cut. As you say, the more interesting figure is the cost of message send + contect switching and reception. As it happens, this is also easier to measure, and the traditional ring benchmark does this pretty well. On my old 400 MHz single-core UltraSPARC at work, this would cost ca 4 usec for a very small message.</p>
<p>Also, as you point out, process creation and teardown is the interesting bit in a dynamic system. As Erlang processes have separate heaps, terminating a process is basically a free() operation + possibly sending notifications to linked processes. </p>
<p>In practice, this tends to mean that you can indeed spawn and kill a process in only a few microseconds on a modern machine. However, I haven&#8217;t really attempted to obtain a precise number, and this is not entirely trivial either, since both process creation and process termination are asynchronous operations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ulf Wiger</title>
		<link>http://ulf.wiger.net/weblog/2008/02/06/what-is-erlang-style-concurrency/comment-page-1/#comment-17183</link>
		<dc:creator>Ulf Wiger</dc:creator>
		<pubDate>Fri, 28 Aug 2009 22:16:36 +0000</pubDate>
		<guid isPermaLink="false">http://ulf.wiger.net/weblog/?p=10#comment-17183</guid>
		<description>@Mark, the &#039;state&#039; of an Erlang process is generally considered to be the current function and its input arguments. Strictly speaking, it&#039;s rather the contents of the function call stack + the contents of the process dictionary + the message queue... Anyway, there is no built-in way to serialize a process and &#039;save&#039; it, although it&#039;s not too difficult to write a function that does this at least well enough for some practical uses.

With &#039;update&#039; I assume you mean code update? Processes tend to either pick up the newest code automatically the next time they enter that module, or can be written to switch to the new code only at a given signal. If processes need to be synchronized during code update (and this is not at all uncommon), OTP provides a set of conventions and control messages to achieve this using normal Erlang message passing. 

With some forethought, one can also use pattern matching at message reception to handle both new and old message formats and act accordingly. This can be particularly useful when processes reside on different nodes, making consistency more expensive. It does clutter the code somewhat, of course.</description>
		<content:encoded><![CDATA[<p>@Mark, the &#8217;state&#8217; of an Erlang process is generally considered to be the current function and its input arguments. Strictly speaking, it&#8217;s rather the contents of the function call stack + the contents of the process dictionary + the message queue&#8230; Anyway, there is no built-in way to serialize a process and &#8217;save&#8217; it, although it&#8217;s not too difficult to write a function that does this at least well enough for some practical uses.</p>
<p>With &#8216;update&#8217; I assume you mean code update? Processes tend to either pick up the newest code automatically the next time they enter that module, or can be written to switch to the new code only at a given signal. If processes need to be synchronized during code update (and this is not at all uncommon), OTP provides a set of conventions and control messages to achieve this using normal Erlang message passing. </p>
<p>With some forethought, one can also use pattern matching at message reception to handle both new and old message formats and act accordingly. This can be particularly useful when processes reside on different nodes, making consistency more expensive. It does clutter the code somewhat, of course.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
