<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/css" href="http://commons.oreilly.com/wiki/skins/common/feed.css?97"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;action=history&amp;feed=atom</id>
		<title>Message Passing Leads to Better Scalability in Parallel Systems - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;action=history&amp;feed=atom"/>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;action=history"/>
		<updated>2013-05-20T04:16:28Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.11.0</generator>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=25320&amp;oldid=prev</id>
		<title>Kevlin at 13:26, 17 August 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=25320&amp;oldid=prev"/>
				<updated>2009-08-17T13:26:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:26, 17 August 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So can we eschew shared memory? Definitely.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So can we eschew shared memory? Definitely.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Instead of using threads and shared memory as our programming model, we can use processes and message passing. ''Process'' here just means a protected independent state with executing code, not necessarily an operating system process. Languages such as Erlang (and occam before it) have shown that processes are a very successful mechanism for programming concurrent and parallel systems. Such systems do not have all the synchronization stresses that shared memory, multi-threaded systems have. Moreover there is a formal model &amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash&lt;/del&gt;; Communicating Sequential Processes (CSP) &amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash&lt;/del&gt;; that can be applied as part of the engineering of such systems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Instead of using threads and shared memory as our programming model, we can use processes and message passing. ''Process'' here just means a protected independent state with executing code, not necessarily an operating system process. Languages such as Erlang (and occam before it) have shown that processes are a very successful mechanism for programming concurrent and parallel systems. Such systems do not have all the synchronization stresses that shared memory, multi-threaded systems have. Moreover there is a formal model &amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/ins&gt;; Communicating Sequential Processes (CSP) &amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/ins&gt;; that can be applied as part of the engineering of such systems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;We can go further and introduce dataflow systems as a way of computing. In a dataflow system there is no explicitly programmed control flow. Instead a directed graph of operators, connected by data paths, is set up and then data fed into the system.  Evaluation is controlled by the readiness of data within the system. Definitely no synchronization problems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;We can go further and introduce dataflow systems as a way of computing. In a dataflow system there is no explicitly programmed control flow. Instead a directed graph of operators, connected by data paths, is set up and then data fed into the system.  Evaluation is controlled by the readiness of data within the system. Definitely no synchronization problems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:25316:newid:25320 --&gt;
&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=25316&amp;oldid=prev</id>
		<title>Kevlin at 13:17, 17 August 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=25316&amp;oldid=prev"/>
				<updated>2009-08-17T13:17:52Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:17, 17 August 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 12:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Having said all this, languages such as C, C++, Java, Python, and Groovy are the principal language of systems development and all of these are presented to programmers as languages for developing shared memory, multi-threaded systems. So what can be done? The answer is to use &amp;amp;mdash; or, if they don't exist, create &amp;amp;mdash; libraries and frameworks that provide process models and message passing, avoiding all use of shared mutable memory.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Having said all this, languages such as C, C++, Java, Python, and Groovy are the principal language of systems development and all of these are presented to programmers as languages for developing shared memory, multi-threaded systems. So what can be done? The answer is to use &amp;amp;mdash; or, if they don't exist, create &amp;amp;mdash; libraries and frameworks that provide process models and message passing, avoiding all use of shared mutable memory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In the C and C++ (also Fortran) worlds, MPI (Message Passing Interface) is a popular tool. The problem it has is that it doesn't provide support for non-primitive data types, programmers have to work with primitive data types or provide a lot of extra infrastructure.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Various people have tried to apply MPI in Java but it has failed &amp;amp;mdash; and this is probably a good thing. Instead there is a growing and increasingly sophisticated infrastructure based on using special data structures to replace any access to shared memory: abstraction is used correctly to raise the level at which programmers work to develop concurrent and parallel systems.  These data structures are tools for sending and receiving messages.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Python is going a different route due to implementation issues with the standard system.  In Python parallel systems make use of multiple instances of the Python system passing messages.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;All in all, not programming with shared memory, but instead using message passing, is likely to be the most successful way of implementing systems that harness the parallelism that is now endemic in computer hardware. Bizarrely perhaps, although processes predate threads as a unit of concurrency, the future seems to be in using threads to implement processes.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;All in all, not programming with shared memory, but instead using message passing, is likely to be the most successful way of implementing systems that harness the parallelism that is now endemic in computer hardware. Bizarrely perhaps, although processes predate threads as a unit of concurrency, the future seems to be in using threads to implement processes.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:25315:newid:25316 --&gt;
&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=25315&amp;oldid=prev</id>
		<title>Kevlin at 13:16, 17 August 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=25315&amp;oldid=prev"/>
				<updated>2009-08-17T13:16:23Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 13:16, 17 August 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Programmers are taught from the very outset of their study of computing that concurrency&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;and especially &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the &lt;/del&gt;special subset of concurrency &amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash; parallelism &amp;amp;ndash&lt;/del&gt;; is hard, that only the very best can ever hope to get it right, and even they get it wrong. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;There is invariably great focus on threads, semaphores, monitors, and how hard it is to get concurrent access to variables to be thread-safe. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; True, there are many difficult problems, and they can be very hard to solve. But what is the core of the problem?  Shared memory.  Almost all the problems of concurrency that people go on and on about relate to the use of shared, mutable memory: race conditions, deadlock, livelock, etc.  The answer seems obvious, either forgo concurrency, or eschew shared memory!&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Programmers are taught from the very outset of their study of computing that concurrency &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;and especially &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;parallelism, a &lt;/ins&gt;special subset of concurrency &amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/ins&gt;; is hard, that only the very best can ever hope to get it right, and even they get it wrong. There is invariably great focus on threads, semaphores, monitors, and how hard it is to get concurrent access to variables to be thread-safe.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Forgoing concurrency &lt;/del&gt;is &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;almost certainly not an option&lt;/del&gt;. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; Computers have more and more cores on an almost quarterly basis, so harnessing parallelism (a special case &lt;/del&gt;of concurrency&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;) becomes more &lt;/del&gt;and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;more important.  We can no longer rely &lt;/del&gt;on &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ever increasing processor clock speeds &lt;/del&gt;to &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;improve application performance. Only by applying parallelism will &lt;/del&gt;the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;performance &lt;/del&gt;of &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;applications improve.  Obviously&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;not improving performance is an option&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;but it is unlikely to be acceptable to users&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;True, there are many difficult problems, and they can be very hard to solve. But what &lt;/ins&gt;is &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;the root of the problem? Shared memory&lt;/ins&gt;. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Almost all the problems &lt;/ins&gt;of concurrency &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that people go on &lt;/ins&gt;and on &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;about relate &lt;/ins&gt;to the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;use &lt;/ins&gt;of &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;shared mutable memory: race conditions&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;deadlock&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;livelock, etc&lt;/ins&gt;. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;The answer seems obvious: Either forgo concurrency or eschew shared memory!&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;So &lt;/del&gt;can &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;we eschew shared memory?  Definitely&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Forgoing concurrency is almost certainly not an option. Computers have more and more cores on an almost quarterly basis, so harnessing true parallelism becomes more and more important. We &lt;/ins&gt;can &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;no longer rely on ever increasing processor clock speeds to improve application performance. Only by exploiting parallelism will the performance of applications improve. Obviously, not improving performance is an option, but it is unlikely to be acceptable to users&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Instead of using threads and shared memory as our programming model, &lt;/del&gt;we &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;can use processes and message passing.  Process here just means a protected independent state with executing code, not necessarily an operating system process.  Languages such as Erlang (and occam before it) have shown that processes are a very successful mechanism for programming concurrent and parallel systems.  Such systems do not have all the synchronization stresses that &lt;/del&gt;shared memory&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, multi-threaded systems have.  Moreover there is a formal model &amp;amp;ndash; Communicating Sequential Processes (CSP) &amp;amp;ndash; that can be applied as part of the engineering of such systems&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;So can &lt;/ins&gt;we &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;eschew &lt;/ins&gt;shared memory&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;? Definitely&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;We can go further &lt;/del&gt;and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;introduce dataflow systems &lt;/del&gt;as &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a way of computing&lt;/del&gt;. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; In &lt;/del&gt;a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;dataflow &lt;/del&gt;system &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;there is no explicitly programmed control flow&lt;/del&gt;. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; Instead &lt;/del&gt;a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;directed graph of operators, connected by data paths, is set up &lt;/del&gt;and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;then data fed into &lt;/del&gt;the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;system&lt;/del&gt;. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; Evaluation &lt;/del&gt;is &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;controlled by the readiness &lt;/del&gt;of &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;data within &lt;/del&gt;the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;system.  Definitely no synchronization problems&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Instead of using threads &lt;/ins&gt;and &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;shared memory &lt;/ins&gt;as &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;our programming model, we can use processes and message passing&lt;/ins&gt;. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;''Process'' here just means &lt;/ins&gt;a &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;protected independent state with executing code, not necessarily an operating &lt;/ins&gt;system &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;process&lt;/ins&gt;. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Languages such as Erlang (and occam before it) have shown that processes are &lt;/ins&gt;a &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;very successful mechanism for programming concurrent &lt;/ins&gt;and &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;parallel systems. Such systems do not have all &lt;/ins&gt;the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;synchronization stresses that shared memory, multi-threaded systems have&lt;/ins&gt;. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Moreover there &lt;/ins&gt;is &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a formal model &amp;amp;ndash; Communicating Sequential Processes (CSP) &amp;amp;ndash; that can be applied as part &lt;/ins&gt;of the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;engineering of such systems&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Having said all this, languages such &lt;/del&gt;as &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;C&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;C++, Java, Python&lt;/del&gt;, and &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Groovy are &lt;/del&gt;the &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;principal language of systems development and all of these are presented to programmers as languages for developing shared memory, multi-threaded systems&lt;/del&gt;. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;So what can be done? &lt;/del&gt; &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;The answer &lt;/del&gt;is &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to use &amp;amp;ndash; or, if they don't exist, create &amp;amp;ndash; libraries and frameworks that provide processes and message passing and avoid all use &lt;/del&gt;of &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;shared mutable memory&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;We can go further and introduce dataflow systems &lt;/ins&gt;as &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a way of computing. In a dataflow system there is no explicitly programmed control flow. Instead a directed graph of operators&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;connected by data paths&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;is set up &lt;/ins&gt;and &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;then data fed into &lt;/ins&gt;the &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;system&lt;/ins&gt;.  &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Evaluation &lt;/ins&gt;is &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;controlled by the readiness &lt;/ins&gt;of &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;data within the system. Definitely no synchronization problems&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;In the &lt;/del&gt;C &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/del&gt;C++ &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;(also Fortran) worlds&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;MPI (Message Passing Interface) is a popular tool&lt;/del&gt;. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;The &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;problem it&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Having said all this, languages such as &lt;/ins&gt;C&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;C++, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Java, Python, and Groovy are the principal language of systems development and all of these are presented to programmers as languages for developing shared memory, multi-threaded systems&lt;/ins&gt;. &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;So what can be done? &lt;/ins&gt;The &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;answer &lt;/ins&gt;is &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;to use &amp;amp;mdash; or, if they don&lt;/ins&gt;'t &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;exist&lt;/ins&gt;, &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;create &amp;amp;mdash; libraries and frameworks that &lt;/ins&gt;provide &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;process models and message passing, avoiding all use &lt;/ins&gt;of &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;shared mutable memory&lt;/ins&gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;has &lt;/del&gt;is &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;that it doesn&lt;/del&gt;'t &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;provide support for non-primitive data types&lt;/del&gt;, &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;programmers have to work with primitive&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;data types or &lt;/del&gt;provide &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a lot &lt;/del&gt;of &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;extra infrastructure&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Various people have tried to apply MPI in Java but it has failed &amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash&lt;/del&gt;; and this is probably a good thing. Instead there is a growing and increasingly sophisticated infrastructure based on using special data structures to replace any access to shared memory: abstraction is used correctly to raise the level at which programmers work to develop concurrent and parallel systems.  These data structures are tools for sending and receiving messages.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;In the C and C++ (also Fortran) worlds, MPI (Message Passing Interface) is a popular tool. The problem it has is that it doesn't provide support for non-primitive data types, programmers have to work with primitive data types or provide a lot of extra infrastructure.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Various people have tried to apply MPI in Java but it has failed &amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/ins&gt;; and this is probably a good thing. Instead there is a growing and increasingly sophisticated infrastructure based on using special data structures to replace any access to shared memory: abstraction is used correctly to raise the level at which programmers work to develop concurrent and parallel systems.  These data structures are tools for sending and receiving messages.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Python is going a different route due to implementation issues with the standard system.  In Python parallel systems make use of multiple instances of the Python system passing messages.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Python is going a different route due to implementation issues with the standard system.  In Python parallel systems make use of multiple instances of the Python system passing messages.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;All in all, not programming with shared memory, but instead using message passing, is likely to be the most successful way of implementing systems that harness the parallelism that is now endemic in computer hardware. &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt; &lt;/del&gt;Bizarrely perhaps, although processes predate threads as a unit of concurrency, the future seems to be in using threads to implement processes.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;All in all, not programming with shared memory, but instead using message passing, is likely to be the most successful way of implementing systems that harness the parallelism that is now endemic in computer hardware. Bizarrely perhaps, although processes predate threads as a unit of concurrency, the future seems to be in using threads to implement processes.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[Russel Winder]]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;By [[Russel Winder]]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=25306&amp;oldid=prev</id>
		<title>Russel at 10:51, 17 August 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=25306&amp;oldid=prev"/>
				<updated>2009-08-17T10:51:13Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 10:51, 17 August 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Programmers are taught from the very outset of their study of computing that concurrency and parallelism is hard, that only the very best can ever hope to get it right, and even they get it wrong.  There is invariably great focus on threads, semaphores, monitors, and how hard it is to get concurrent access to variables to be thread-safe.  True, there are many difficult problems, and they can be very hard to solve. But what is the core of the problem?  Shared memory.  Almost all the problems of concurrency &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and parallelism &lt;/del&gt;that people go on and on about relate to the use of shared, mutable memory.  The answer seems obvious, either forgo concurrency &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and parallelism&lt;/del&gt;, or eschew shared memory!&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Programmers are taught from the very outset of their study of computing that concurrency&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;and &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;especially the special subset of concurrency &amp;amp;ndash; &lt;/ins&gt;parallelism &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;ndash; &lt;/ins&gt;is hard, that only the very best can ever hope to get it right, and even they get it wrong.  There is invariably great focus on threads, semaphores, monitors, and how hard it is to get concurrent access to variables to be thread-safe.  True, there are many difficult problems, and they can be very hard to solve. But what is the core of the problem?  Shared memory.  Almost all the problems of concurrency that people go on and on about relate to the use of shared, mutable memory&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;: race conditions, deadlock, livelock, etc&lt;/ins&gt;.  The answer seems obvious, either forgo concurrency, or eschew shared memory!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Forgoing concurrency &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;and parallelism &lt;/del&gt;is almost certainly not an option.  Computers have more and more cores on an almost quarterly basis, so harnessing parallelism becomes more and more important.  We can no longer rely on ever increasing processor clock speeds to improve application performance. Only by applying parallelism will the performance of applications improve.  Obviously, not improving performance is an option, but it is unlikely to be acceptable to users.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Forgoing concurrency is almost certainly not an option.  Computers have more and more cores on an almost quarterly basis, so harnessing parallelism &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;(a special case of concurrency) &lt;/ins&gt;becomes more and more important.  We can no longer rely on ever increasing processor clock speeds to improve application performance. Only by applying parallelism will the performance of applications improve.  Obviously, not improving performance is an option, but it is unlikely to be acceptable to users.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So can we eschew shared memory?  Definitely.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So can we eschew shared memory?  Definitely.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Instead of using threads and shared memory as our programming model, we can use processes and message passing.  Languages such as Erlang (and occam before it) have shown that &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;concurrency and parallelism based on &lt;/del&gt;processes &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;is &lt;/del&gt;a very successful &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;way of &lt;/del&gt;programming concurrent and parallel systems.  Such systems do not have all the synchronization stresses that shared memory, multi-threaded systems have.  Moreover there is a &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mathematics &lt;/del&gt;&amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/del&gt;; Communicating Sequential Processes (CSP) &amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/del&gt;; that can be applied as part of the engineering of &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;concurrent and parallel &lt;/del&gt;systems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Instead of using threads and shared memory as our programming model, we can use processes and message passing&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;.  Process here just means a protected independent state with executing code, not necessarily an operating system process&lt;/ins&gt;.  Languages such as Erlang (and occam before it) have shown that processes &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;are &lt;/ins&gt;a very successful &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mechanism for &lt;/ins&gt;programming concurrent and parallel systems.  Such systems do not have all the synchronization stresses that shared memory, multi-threaded systems have.  Moreover there is a &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;formal model &lt;/ins&gt;&amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash&lt;/ins&gt;; Communicating Sequential Processes (CSP) &amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash&lt;/ins&gt;; that can be applied as part of the engineering of &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;such &lt;/ins&gt;systems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;We can go further and introduce dataflow systems as a way of computing.  In a dataflow system there is no explicitly programmed control flow.  Instead a directed graph of operators connected by data paths is set up and then data fed into the system.  Evaluation is controlled by the readiness of data within the system.  Definitely no synchronization problems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;We can go further and introduce dataflow systems as a way of computing.  In a dataflow system there is no explicitly programmed control flow.  Instead a directed graph of operators&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;connected by data paths&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;is set up and then data fed into the system.  Evaluation is controlled by the readiness of data within the system.  Definitely no synchronization problems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Having said all this, languages such as C, C++, Java, Python, and Groovy are the principal language of systems development and&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Having said all this, languages such as C, C++, Java, Python, and Groovy are the principal language of systems development and all of these are presented to programmers as languages for developing shared memory, multi-threaded systems. So what can be done?  The answer is to use &amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash&lt;/ins&gt;; or, if they don't exist, create &amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash&lt;/ins&gt;; libraries and frameworks that provide processes and message passing and avoid all use of shared mutable memory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;all of these are presented to programmers as languages for developing shared memory, multi-threaded systems. So what can be done?  The answer is to use &amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/del&gt;; or, if they don't exist, create &amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/del&gt;; libraries and frameworks that provide processes and message passing and avoid all use of shared mutable memory.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In the C and C++ (also Fortran) worlds, MPI (Message Passing Interface) is a popular tool.  The problem it&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In the C and C++ (also Fortran) worlds, MPI (Message Passing Interface) is a popular tool.  The problem it&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 15:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;data types or provide a lot of extra infrastructure.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;data types or provide a lot of extra infrastructure.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Various people have tried to apply MPI in Java but it has failed &amp;amp;&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;mdash&lt;/del&gt;; and this is probably a good thing. Instead there is a growing and increasingly sophisticated infrastructure based on using special data structures to replace any access to shared memory: abstraction is used correctly to raise the level at which programmers work to develop concurrent and parallel systems.  These data structures are tools for sending and receiving messages.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Various people have tried to apply MPI in Java but it has failed &amp;amp;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;ndash&lt;/ins&gt;; and this is probably a good thing. Instead there is a growing and increasingly sophisticated infrastructure based on using special data structures to replace any access to shared memory: abstraction is used correctly to raise the level at which programmers work to develop concurrent and parallel systems.  These data structures are tools for sending and receiving messages.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Python is going a different route due to implementation issues with the standard system.  In Python parallel systems make use of multiple instances of the Python system passing messages.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Python is going a different route due to implementation issues with the standard system.  In Python parallel systems make use of multiple instances of the Python system passing messages.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;!-- diff cache key wikicontent:diff:version:1.11a:oldid:24492:newid:25306 --&gt;
&lt;/table&gt;</summary>
		<author><name>Russel</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=24492&amp;oldid=prev</id>
		<title>Kevlin at 12:33, 24 June 2009</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=24492&amp;oldid=prev"/>
				<updated>2009-06-24T12:33:30Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;

			&lt;table style=&quot;background-color: white; color:black;&quot;&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;col class='diff-marker' /&gt;
			&lt;col class='diff-content' /&gt;
			&lt;tr&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;←Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 12:33, 24 June 2009&lt;/td&gt;
			&lt;/tr&gt;
		&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 1:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Programmers are taught from the very outset of their study of computing that concurrency and parallelism is hard, that only the very best can ever hope to get it right, and even they get it wrong.  There is invariably great focus on threads, semaphores, monitors, and how hard it is to get concurrent access to variables to be thread-safe.  True, there are many difficult problems, and they can be very hard to solve. But what is the core of the problem?  Shared memory.  Almost all the problems of concurrency and parallelism that people go on and on about relate to the use of shared, mutable memory.  The answer seems obvious, either forgo concurrency and parallelism, or eschew shared memory!&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Programmers are taught from the very outset of their study of computing that concurrency and parallelism is hard, that only the very best can ever hope to get it right, and even they get it wrong.  There is invariably great focus on threads, semaphores, monitors, and how hard it is to get concurrent access to variables to be thread-safe.  True, there are many difficult problems, and they can be very hard to solve. But what is the core of the problem?  Shared memory.  Almost all the problems of concurrency and parallelism that people go on and on about relate to the use of shared, mutable memory.  The answer seems obvious, either forgo concurrency and parallelism, or eschew shared memory!&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Forgoing concurrency and parallelism is almost certainly not an option.  Computers have more and more cores&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Forgoing concurrency and parallelism is almost certainly not an option.  Computers have more and more cores on an almost quarterly basis, so harnessing parallelism becomes more and more important.  We can no longer rely on ever increasing processor clock speeds to improve application performance. Only by applying parallelism will the performance of applications improve.  Obviously, not improving performance is an option, but it is unlikely to be acceptable to users.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;on an almost quarterly basis, so harnessing parallelism becomes more and more important.  We can no longer&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;rely on ever increasing processor clock speeds to improve application performance. Only by applying&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;parallelism will the performance of applications improve.  Obviously, not improving performance is an&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;option, but it is unlikely to be acceptable to users.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So can we eschew shared memory?  Definitely.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So can we eschew shared memory?  Definitely.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Instead of using threads and shared memory as our programming model, we can use processes and message&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Instead of using threads and shared memory as our programming model, we can use processes and message passing.  Languages such as Erlang (and occam before it) have shown that concurrency and parallelism based on processes is a very successful way of programming concurrent and parallel systems.  Such systems do not have all the synchronization stresses that shared memory, multi-threaded systems have.  Moreover there is a mathematics &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;Communicating Sequential Processes (CSP) &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;that can be applied as part of the engineering of concurrent and parallel systems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;passing.  Languages such as Erlang (and occam before it) have shown that concurrency and parallelism based&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;on processes is a very successful way of programming concurrent and parallel systems.  Such systems do not&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;have all the synchronization stresses that shared memory, multi-threaded systems have.  Moreover there is a&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;mathematics &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;Communicating Sequential Processes (CSP) &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;that can be applied as part of the engineering of&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;concurrent and parallel systems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;We can go further and introduce dataflow systems as a way of computing.  In dataflow&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/del&gt;there is no explicitly&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;We can go further and introduce dataflow systems as a way of computing.  In &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;a &lt;/ins&gt;dataflow &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;system &lt;/ins&gt;there is no explicitly programmed control flow.  Instead a directed graph of operators connected by data paths is set up and then data fed into the system.  Evaluation is controlled by the readiness of data within the system.  Definitely no synchronization problems.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;programmed control flow.  Instead a directed graph of operators connected by data paths is set up and then&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;data fed into the system.  Evaluation is controlled by the readiness of data within the system.  Definitely&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;no synchronization problems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Having said all this C, C++, Java, Python and Groovy are the principal language of systems development and&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Having said all this&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, languages such as &lt;/ins&gt;C, C++, Java, Python&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;and Groovy are the principal language of systems development and&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;all of these are presented to programmers as languages for developing shared memory, multi-threaded systems.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;all of these are presented to programmers as languages for developing shared memory, multi-threaded systems. So what can be done?  The answer is to use &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;or&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;, &lt;/ins&gt;if they don't exist, create &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;libraries and frameworks that provide processes and message passing and avoid all use of shared mutable memory.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;So what can be done?  The answer is to use &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;(&lt;/del&gt;or if they don't exist, create&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;) &lt;/del&gt;libraries and frameworks that&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;provide processes and message passing and avoid all use of shared&lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;,&lt;/del&gt;mutable memory.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In the C and C++ (also Fortran) worlds, MPI (Message Passing Interface) is a popular tool.  The problem it&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;In the C and C++ (also Fortran) worlds, MPI (Message Passing Interface) is a popular tool.  The problem it&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 30:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 16:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;data types or provide a lot of extra infrastructure.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;data types or provide a lot of extra infrastructure.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Various people have tried to apply MPI in Java but it has failed &lt;del style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;-- &lt;/del&gt;and this is probably a good thing.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Various people have tried to apply MPI in Java but it has failed &lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;&amp;amp;mdash; &lt;/ins&gt;and this is probably a good thing. Instead there is a growing and increasingly sophisticated infrastructure based on using special data structures to replace any access to shared memory: abstraction is used correctly to raise the level at which programmers work to develop concurrent and parallel systems.  These data structures are tools for sending and receiving messages.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Instead there is a growing and increasingly sophisticated infrastructure based on using special data&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;structures to replace any access to shared memory: abstraction is used correctly to raise the level at which&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;programmers work to develop concurrent and parallel systems.  These data structures are tools for sending&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;and receiving messages.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Python is going a different route due to implementation issues with the standard system.  In Python parallel&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Python is going a different route due to implementation issues with the standard system.  In Python parallel systems make use of multiple instances of the Python system passing messages.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;systems make use of multiple instances of the Python system passing messages.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt; &lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;All in all, not programming with shared memory, but instead using message passing, is likely to be the most&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;All in all, not programming with shared memory, but instead using message passing, is likely to be the most successful way of implementing systems that harness the parallelism that is now endemic in computer hardware.  Bizarrely perhaps, although processes predate threads as a unit of concurrency, the future seems to be in using threads to implement processes.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;successful way of implementing systems that harness the parallelism that is now endemic in computer&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;hardware.  Bizarrely perhaps, although processes predate threads as a unit of concurrency, the future seems&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;By [[Russel Winder]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;-&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;to be in using threads to implement processes.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;This work is licensed under a [http://creativecommons.org/licenses/by/3.0/us/ Creative Commons Attribution 3] &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;nbsp;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;color: red; font-weight: bold; text-decoration: none;&quot;&gt;Back to [[97 Things Every Programmer Should Know]] home page&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Kevlin</name></author>	</entry>

	<entry>
		<id>http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=23362&amp;oldid=prev</id>
		<title>Russel: New page: Programmers are taught from the very outset of their study of computing that concurrency and parallelism is hard, that only the very best can ever hope to get it right, and even they get i...</title>
		<link rel="alternate" type="text/html" href="http://commons.oreilly.com/wiki/index.php?title=Message_Passing_Leads_to_Better_Scalability_in_Parallel_Systems&amp;diff=23362&amp;oldid=prev"/>
				<updated>2009-02-07T19:04:21Z</updated>
		
		<summary type="html">&lt;p&gt;New page: Programmers are taught from the very outset of their study of computing that concurrency and parallelism is hard, that only the very best can ever hope to get it right, and even they get i...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Programmers are taught from the very outset of their study of computing that concurrency and parallelism is hard, that only the very best can ever hope to get it right, and even they get it wrong.  There is invariably great focus on threads, semaphores, monitors, and how hard it is to get concurrent access to variables to be thread-safe.  True, there are many difficult problems, and they can be very hard to solve. But what is the core of the problem?  Shared memory.  Almost all the problems of concurrency and parallelism that people go on and on about relate to the use of shared, mutable memory.  The answer seems obvious, either forgo concurrency and parallelism, or eschew shared memory!&lt;br /&gt;
&lt;br /&gt;
Forgoing concurrency and parallelism is almost certainly not an option.  Computers have more and more cores&lt;br /&gt;
on an almost quarterly basis, so harnessing parallelism becomes more and more important.  We can no longer&lt;br /&gt;
rely on ever increasing processor clock speeds to improve application performance. Only by applying&lt;br /&gt;
parallelism will the performance of applications improve.  Obviously, not improving performance is an&lt;br /&gt;
option, but it is unlikely to be acceptable to users.&lt;br /&gt;
&lt;br /&gt;
So can we eschew shared memory?  Definitely.&lt;br /&gt;
&lt;br /&gt;
Instead of using threads and shared memory as our programming model, we can use processes and message&lt;br /&gt;
passing.  Languages such as Erlang (and occam before it) have shown that concurrency and parallelism based&lt;br /&gt;
on processes is a very successful way of programming concurrent and parallel systems.  Such systems do not&lt;br /&gt;
have all the synchronization stresses that shared memory, multi-threaded systems have.  Moreover there is a&lt;br /&gt;
mathematics -- Communicating Sequential Processes (CSP) -- that can be applied as part of the engineering of&lt;br /&gt;
concurrent and parallel systems.&lt;br /&gt;
&lt;br /&gt;
We can go further and introduce dataflow systems as a way of computing.  In dataflow, there is no explicitly&lt;br /&gt;
programmed control flow.  Instead a directed graph of operators connected by data paths is set up and then&lt;br /&gt;
data fed into the system.  Evaluation is controlled by the readiness of data within the system.  Definitely&lt;br /&gt;
no synchronization problems.&lt;br /&gt;
&lt;br /&gt;
Having said all this C, C++, Java, Python and Groovy are the principal language of systems development and&lt;br /&gt;
all of these are presented to programmers as languages for developing shared memory, multi-threaded systems.&lt;br /&gt;
So what can be done?  The answer is to use (or if they don't exist, create) libraries and frameworks that&lt;br /&gt;
provide processes and message passing and avoid all use of shared,mutable memory.&lt;br /&gt;
&lt;br /&gt;
In the C and C++ (also Fortran) worlds, MPI (Message Passing Interface) is a popular tool.  The problem it&lt;br /&gt;
has is that it doesn't provide support for non-primitive data types, programmers have to work with primitive&lt;br /&gt;
data types or provide a lot of extra infrastructure.&lt;br /&gt;
&lt;br /&gt;
Various people have tried to apply MPI in Java but it has failed -- and this is probably a good thing.&lt;br /&gt;
Instead there is a growing and increasingly sophisticated infrastructure based on using special data&lt;br /&gt;
structures to replace any access to shared memory: abstraction is used correctly to raise the level at which&lt;br /&gt;
programmers work to develop concurrent and parallel systems.  These data structures are tools for sending&lt;br /&gt;
and receiving messages.&lt;br /&gt;
&lt;br /&gt;
Python is going a different route due to implementation issues with the standard system.  In Python parallel&lt;br /&gt;
systems make use of multiple instances of the Python system passing messages.&lt;br /&gt;
&lt;br /&gt;
All in all, not programming with shared memory, but instead using message passing, is likely to be the most&lt;br /&gt;
successful way of implementing systems that harness the parallelism that is now endemic in computer&lt;br /&gt;
hardware.  Bizarrely perhaps, although processes predate threads as a unit of concurrency, the future seems&lt;br /&gt;
to be in using threads to implement processes.&lt;/div&gt;</summary>
		<author><name>Russel</name></author>	</entry>

	</feed>