<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" media="screen" href="/styles/xslt/rss.xslt"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" xmlns:c9="http://channel9.msdn.com">
<channel>
	<title>Comment Feed for Frank Hileman</title>
	<atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/Niners/Frank Hileman/Comments/RSS"></atom:link>
	<image>
		<url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url>
		<title>Frank Hileman</title>
		<link></link>
	</image>
	<description></description>
	<link></link>
	<language>en</language>
	<pubDate>Mon, 20 May 2013 17:45:48 GMT</pubDate>
	<lastBuildDate>Mon, 20 May 2013 17:45:48 GMT</lastBuildDate>
	<generator>Rev9</generator>
	<item>
		<title>Re: PerfView Tutorial 1 - Collecting data with the Run command</title>
		<description>
			<![CDATA[<p>Thanks Vance. I found the videos useful. I only recommend a better microphone.</p><p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Series/PerfView-Tutorial/PerfView-Tutorial-1-Collecting-data-with-the-Run-command#c634786677327703389</link>
		<pubDate>Mon, 23 Jul 2012 19:15:32 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Series/PerfView-Tutorial/PerfView-Tutorial-1-Collecting-data-with-the-Run-command#c634786677327703389</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Stephen Toub: Inside TPL Dataflow</title>
		<description>
			<![CDATA[ <p>Hi Charles,</p><p>I did not notice I was not logged in. Maybe previously I had to log in to comment at all. Thanks.</p><p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Stephen-Toub-Inside-TPL-Dataflow#c634327174650000000</link>
		<pubDate>Mon, 07 Feb 2011 23:17:45 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Stephen-Toub-Inside-TPL-Dataflow#c634327174650000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Hanselminutes on 9 - Why Aren&#39;t There More WinForms Talks with Rocky Lhotka</title>
		<description>
			<![CDATA[
<p>For vector graphics development, I find the WPF API clumsy. I am not happy with the memory use either. I am not comparing to windows forms, but to other vector graphics APIs.</p>
<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/HanselminutesOn9/Hanselminutes-on-9-Why-Arent-There-More-WinForms-Talks-with-Rocky-Lhotka#c633816342620000000</link>
		<pubDate>Fri, 26 Jun 2009 17:31:02 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/HanselminutesOn9/Hanselminutes-on-9-Why-Arent-There-More-WinForms-Talks-with-Rocky-Lhotka#c633816342620000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Windows 7: Writing Your Application to Shine on Modern Graphics Hardware</title>
		<description>
			<![CDATA[I am very, very happy to see the return of an immediate mode 2d API, Direct2D. I only wish it were available on all windows platforms. An immediate mode API is especially needed on low-end hardware.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Events/PDC/PDC08/PC04#c633630801610000000</link>
		<pubDate>Sun, 23 Nov 2008 23:36:01 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Events/PDC/PDC08/PC04#c633630801610000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Expert to Expert: Contract Oriented Programming and Spec#</title>
		<description>
			<![CDATA[
<p>The first question people have regarding contracts is, why bother? The speakers addressed this by explaining how much money Microsoft saved in manual testing time. But there are other savings as well.<br /><br />By specifying assumptions explicitly, the design improves. You move from fuzzy verbal communication&nbsp;to concise, precise communication about the behavior and expectations of code. This has the same benefits as writing documentation before code, or writing tests
 before code. It clarifies the design.<br /><br />Even without compile-time or run-time contract checks, a contract allows one to view classes or methods as black boxes with precise behavior, ignoring internal details. This helps to logically determine if a design functions correctly.<br /><br />Another benefit is reduced debugging time. If you use only run-time contract checks, you eliminate the time normally spent trying to narrow down a bug -- you find it earlier, before it is manifested in peculiar ways. If you have compile time checking as well,
 as in spec#, the same bug would never occur -- it would spotted by the compiler.<br /><br />The work done by the spec# group is important. I hope it goes into products as soon as possible.</p>
<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Contract-Oriented-Programming-and-Spec#c633476121810000000</link>
		<pubDate>Wed, 28 May 2008 22:56:21 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Contract-Oriented-Programming-and-Spec#c633476121810000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">foostar wrote:</div>
<div class="quoteBody">I'm not convinced that SCOOP can work. The problem I see with it is that it allows for arbitrary sharing of state among concurrently executing objects. If it can be made to work then the compiler will probably have to make such conservative
 decisions wrto synchronization that performance will be a tiny fraction of the theoretical optimum.
<br /></div>
</blockquote>
<br />Is this really true? My understanding is that SCOOP is very high level and there are a number of different ways it could be implemented internally. For example, it could be implemented on top of message passing?<br /><br />I like the SCOOP concepts. Being a fan of design by contract for many years now, I like especially the way it works neatly with contracts. I would like to think foostar is incorrect in these assumptions.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers#c633427044360000000</link>
		<pubDate>Wed, 02 Apr 2008 03:40:36 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers#c633427044360000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Joe Duffy, Huseyin Yildiz, Daan Leijen, Stephen Toub - Parallel Extensions: Inside the Task Parallel</title>
		<description>
			<![CDATA[For those who like language extensions: you may like an extensible language instead:<br /><br /><a href="http://boo.codehaus.org/Syntactic&#43;Macros">http://boo.codehaus.org/Syntactic&#43;Macros</a><p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Joe-Duffy-Huseyin-Yildiz-Daan-Leijen-Stephen-Toub-Parallel-Extensions-Inside-the-Task-Parallel#c633396848950000000</link>
		<pubDate>Wed, 27 Feb 2008 04:54:55 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Joe-Duffy-Huseyin-Yildiz-Daan-Leijen-Stephen-Toub-Parallel-Extensions-Inside-the-Task-Parallel#c633396848950000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[
<p>Message passing in games:</p>
<p><a href="http://softwaremaven.innerbrane.com/2007/12/python-versus-erlang-for-mmog.html">http://softwaremaven.innerbrane.com/2007/12/python-versus-erlang-for-mmog.html</a><br /><br />That is only distributed server stuff. It seems message passing would work well on clients as well, given that the game might be modeled as many independent actors interacting with one another.</p>
<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633392526620000000</link>
		<pubDate>Fri, 22 Feb 2008 04:51:02 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633392526620000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[
<p>There is no way to tell if an efficient message passing system would be as fast or faster than transactional memory for your scenario, without building and trying it out. But I suspect there is some bias against the idea of lightweight processes and efficient
 message passing, because we see so few common implementations with that level of efficiency.<br /><br />If you read some of the links I pointed out earlier, they explain how message passing is a lower level building block than transactional memory. Being lower level, it can be faster as well, when you do not need full transactions.<br /><br />I have nothing against transactional memory except that it helps preserve existing serial ways of thinking. Share nothing, message passing concurrency, seems to balance and scale almost automatically.</p>
<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633392519140000000</link>
		<pubDate>Fri, 22 Feb 2008 04:38:34 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633392519140000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">sylvan wrote:</div>
<div class="quoteBody">&#65279;
<blockquote>
<table class="quoteTable">
<tbody>
<tr>
<td valign="top" width="10"><img src="/Themes/AlmostGlass/images/icon-quote.gif"></td>
<td class="txt3"><strong>Frank Hileman wrote:</strong>
<hr size="1">
<i>&#65279;<br /><br />If you have decided by design that all messages to the barrel modify its state, and that all messages are dependent upon the state of the barrel (ie are invalid if the barrel has been modified), you have serialized access to the barrel by design. It does not
 matter what form of concurrency you use, locks, message passing, transactions, it is the same problem, and is the same problem a CPU has when determining the dispatch order of instructions that write to a memory location.</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br /><br />No, it's not serialized by design, in fact it's (deliberately) extremely parallel by design, with the occasional rare conflict. You have tens of thousands of objects, most of which don't care one bit about that barrel, but sometimes one of them does, and even
 more rarely two or more of them do. <br />The point is that the mere infinitismal <i>possibility </i>of conflicts cause 100% serialization when you use message passing, whereas with transactions you can run in parallel, and deal with those rare cases of conflicts when and only when they actually occur.<br /><br />If it's just the case of a single barrel you may be able to hack your own optimistic transactional memory on top of the messages (e.g. you have one message which does not block that you can use to check if you need to update the barrel, and if so you just do
 it again with the atomic version - that way 99.9% of the objects would just decide that they don't care about the barrel at all and leave it alone), but it gets much worse in real world scenarios. In practice you'll often have each object want read N unspecified
 objects from the world, and modify M other unspecified objects in the world (which may or may not overlap with the N that you read). There is no way to know up front which objects you need to read/modify, you only know the exact set of objects that was needed
<i>after</i> the operation has occured. All this has to happen atomically, naturally, which means that with message passing you'll be forced to have a single service guarding &quot;The World&quot;, and each object's operations on the world will be entirely serialized.
 It's simply impossible to do this concurrently if your world is guarded by a message process, even though the number of
<i>actual</i> conflicts that these atomic operations have are very very low.<br />And again, with transactional memory, the problem simply disappears and you get near linear speedup as you add more CPU:s.<br /><br />Also, I didn't &quot;design&quot; the problem to be difficult for message passing, it just <i>
was</i> difficult for message passing all by itself. Sometimes the thing you're simulating just isn't suitable to message passing. You can't blame the problem because the language doesn't offer a good way of solving it!<br /><br />Look, I'm the biggest FP advocate there is. I like Erlang et al. as much as the next guy (though my favourite language is Haskell), but the fact of the matter is that there are real problems that can not be solved with message passing. In my experience, most
 applications that are actually concurrent by nature (servers, etc.) can use message passing good effect, but when you try to speed up non-concurrent applications the instances where your problems map nicely to threads and messages start to become more rare.
 We can't just ignore these problems (again, Almdahl's law won't let us), we need to provide a solution for them too. That's why we need many ways of doing these things. In most cases you can be data parallel, in some cases you need task based parallelism,
 and in yet fewer cases you can use threads and message passing, and in fewer cases still you need transactional memory. We can't leave any of these out though, as that would disqualify the language from being considered &quot;general purpose&quot; w.r.t. concurrency/parallelism,
 IMO.<br /></div>
</blockquote>
<br /><br />Games work exceptionally well with message passing. As I discussed regarding your previous ai scenario, if the message to the barrel (change state) includes a &quot;barrel state stamp&quot; then the barrel knows it can change state, assuming that stamp matches the current
 barrel state. If this is hard to envision, imagine the barrel increments a private counter every time it changes important state (important to the message sender). That counter is the state stamp.<br /><br />When the barrel receives your state changing message, it can process it&nbsp;as long as there is not other similar messages competing. If the state stamp has changed it&nbsp;must&nbsp;tell the sender that message was discarded, as it is no longer valid. Then the&nbsp;sender can
 recompute or abandon.<br /><br />This is essentially what happens with transactions as well. The messages as I describe are a type of optimistic transaction. Scalability in games is probably acheived by minimizing choke points, regardless of the concurrency mechanmism used.<br /><br />There is no more serialization with message passing than with transactions. If you have many processes modifying the same mutable state in your barrel, and all these modifications are dependent on the state of the barrel (ie invalid if state has changed) you
 have a contention problem that is not solved by any concurrency mechanism. Messaging does not make this worse. If most processes are not modifying your barrel state, they are not barrel state dependent, and there is no serialization problem as you describe.
 Then both messaging and transations work well.<br /><br />Your second argument, regarding N reads and M writes, you claim is solved better by a transaction. All you are doing is breaking up the granularity. You can do the exact same thing with messages. Instead&nbsp;treating the whole world as one process, break up the
 writes into messages&nbsp;to M processes. If all must be done atomically, then you do need a transactional system built using messages. Ultimately&nbsp;such a&nbsp;transactional system must commit writes.
<br /><br />One way you might do it is a two stage commit. First the supervisor (modifying) process sends a message to each M process acquiring a lock. Assuming a message is sent back with succeed or fail, the next step is to send a message to each M process to actually
 mutate data. During that time each M process cannot be modified by anything else (ie is temporarily owned by the supervisor process). After mutation is complete, the lock is freed. This only requires two messages to each M process and one message back from
 each M process. This is a fine grained form of locking and does not block any other processes from modifying any other mutable data in the meantime. Nor do the locks prevent reading messages from being processed. Only a writing or lock acquiring message would
 fail, and only to those specific pieces of data.<br /><br />The point is you can do anything you wish with message passing. It is a fundamental building block, and can scale as well as your design permits. If your design has no need for atomic composite commits, you can do that. If you do need atomic composite commits,
 you can do that as well.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633391746390000000</link>
		<pubDate>Thu, 21 Feb 2008 07:10:39 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633391746390000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">sylvan wrote:</div>
<div class="quoteBody">&#65279;How could these message be run in parallel, if each of these message requires atomic updates? I.e I need to do &quot;Find position of explosive barrel, if I collide with it then explod it&quot;, it's no good if someon else does this at the same
 time and moves the barrel after I've read the position but before I explode it! How could you possibly know that two threads who both read data from the game world (for example) will not decide to write to the same place as a result of that read? Atomic access
 is key, and with message passing that means the accesses get serialised.<br /></div>
</blockquote>
<br /><br />If you have decided by design that all messages to the barrel modify its state, and that all messages are dependent upon the state of the barrel (ie are invalid if the barrel has been modified), you have serialized access to the barrel by design. It does not
 matter what form of concurrency you use, locks, message passing, transactions, it is the same problem, and is the same problem a CPU has when determining the dispatch order of instructions that write to a memory location.<br /><br />The description I gave previously of the ai and world processes applies to your barrel scenario. Ideally the game is designed so that serialization is not needed by design -- ie the barrel explodes regardless of whether it has moved. If you decide to create
 a choke point in your design, and all processes are&nbsp;hitting that&nbsp;spot at the same time,&nbsp;you have designed something that does not parallelize well, regardless of the concurrency mechanism.<br /><br />Massively multiplayer games use messaging extensively, and probably avoid that type of &quot;serialization by design&quot;.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633391208250000000</link>
		<pubDate>Wed, 20 Feb 2008 16:13:45 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633391208250000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[Anyone interested in comparing message&nbsp;passing concurrency to other techniques may wish to read this:<br /><br /><a href="http://www.info.ucl.ac.be/~pvr/bookcc.html">http://www.info.ucl.ac.be/~pvr/bookcc.html</a><br /><br />And in particular this paper:<br /><br /><a href="http://www.info.ucl.ac.be/~pvr/flopsPVRarticle.pdf">http://www.info.ucl.ac.be/~pvr/flopsPVRarticle.pdf</a><p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390908100000000</link>
		<pubDate>Wed, 20 Feb 2008 07:53:30 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390908100000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">sylvan wrote:</div>
<div class="quoteBody">&#65279;In some cases message passing just doesn't work well at all. For example you may want 10000 objects to be able to query the same data (but only one or two of those objects of those modifies the data). Do you really want each to pass
 through a protocol with just a single thread &quot;owning&quot; that data? Sounds like a recipe for disaster w.r.t. performance to me. Transactions scale very well in situations like that (which is extremely common in practice), because each thread can do all the reading
 it wants to without interfering with the execution of any other threads.<br /></div>
</blockquote>
<br /><br />Again, assuming you do not mean &quot;threads&quot; but some lightweight process concept, this is a problem for the message dispatcher, not the programmer. The dispatcher can recognize a sequence of many messages retrieving data, and they can all be run in parallel.
 There is no need to serialize the message processing until state is mutated. That is why messaging and functional programming work so well together. Any locking or true OS threads are hidden to the programmer.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390820860000000</link>
		<pubDate>Wed, 20 Feb 2008 05:28:06 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390820860000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">sylvan wrote:</div>
<div class="quoteBody">&#65279;<br />EDIT: Oh, and consider the problem of granularity. Take the example of a game. You're running a thread for an AI character who wants to perform an action on the game world atomically. How do you solve that? Do you ask the World object to retrieve whatever it
 is the AI wants to access? In other words is the World object's service going to act as basically having one big lock on it for any atomic updates that AI characters want to do? Or do you put the implicit &quot;lock&quot; somewhere further down in the hierarchy (e.g.
 on individual objects in the world)? If so, how is this different from just having locks on the individual objects? How do you solve the problem of not knowing up front which objects you want to modify (because the set of objects you need depends on the values
 you find in the first couple of objects you examine)? Aren't we back in the old hornets nest of locks and condition variables again?<br />So basically we either have to let the toplevel object provide a transactional interface (amounting to a big implicit lock), and basically eliminate any chances of parallelism, or we go back to horribly impractical fine grained locking with all the problems
 that poses. In this scenario, message passing gives no improvement to us, whereas transactional memory &quot;just works&quot; without any synchronisation burden placed on the programmer at all!</div>
</blockquote>
<br /><br />Ignoring the &quot;thread&quot; implementation idea (since the isolated units are less than threads), and other implementation assumptions,&nbsp;I assume you are stating the problems as: world, one big unit containing&nbsp;smaller pieces of mutating data, and ai characters, many
 smaller units that interact with this. Let's call the units&nbsp;processes (not process in the OS sense). What interaction do you see between these processes?<br /><br />I am not sure how you would define the interaction, but intuitively, I think you selected an&nbsp;example where message passing works well (and is probably why massive multiplayer games use messaging). Lets suppose each ai process receives&nbsp; message&nbsp;G to retrieve
 data from the world, and sends message&nbsp;S to mutate the world.<br /><br />Each message is queued. Assume the world has a set of messages queued, of type S. Assume it is sending out G in between S processing work.&nbsp;<br /><br />AI1 requested data and got a message G. It sends out S based on the values in G, lets call it world state 1. In the mean time the world has changed. By the time it processes that S, it is in world state 2.<br />&nbsp;<br />1) How can an ai reliably compute the data for S if the world is constantly changing state?<br /><br />2) How much parallelism have we lost by putting so much mutable&nbsp;data in the large world process?<br /><br />The answer to question 1 is usually in the design of the algorithms. Ideally the difference between world state 1 and 2 does not affect the validity of the ai message S to the world. That is, it may be something like, add this amount of energy to a particle,
 not, set the absolute value of the energy of this particle. A delta, for a game, is probably more appropriate.<br /><br />If the validity of the message is&nbsp;dependent upon&nbsp;the world state, message S could include as data a &quot;world state stamp&quot;, that is an identifier showing that S is only valid if the world is still in state 1. Message G, from the world to the state would include
 this stamp.<br /><br />The world process would then ignore S messages with past due stamps, resending G to the sender ai processes with ignored S messages, so they could recompute.<br /><br />This would be a contention problem with one giant world process. Which leads to the second question, granularity. If the world is broken up into many smaller processes, the contention could potentially go away, assuming every ai is not working with a&nbsp;world
 state dependent algorithm, with each&nbsp;trying to modify the same small mutable state with that same algorithm.<br /><br />Messaging does not make contention problems go away, it is true. You must still design the system correctly to avoid that.&nbsp;<br /><br />I would argue messaging makes contention problems easier to identify and analyze, because now you deal only with the contention problem itself, instead of synthetic problems introduced with traditional muti-threading and locks.<br /><p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390811920000000</link>
		<pubDate>Wed, 20 Feb 2008 05:13:12 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390811920000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">staceyw wrote:</div>
<div class="quoteBody">&#65279;
<blockquote>
<table class="quoteTable">
<tbody>
<tr>
<td valign="top" width="10"><img src="/Themes/AlmostGlass/images/icon-quote.gif"></td>
<td class="txt3"><strong>sylvan wrote:</strong>
<hr size="1">
<i>&#65279;
<blockquote>
<table class="quoteTable">
<tbody>
<tr>
<td valign="top" width="10"><img src="/Themes/AlmostGlass/images/icon-quote.gif"></td>
<td class="txt3"><strong>Frank Hileman wrote:</strong>
<hr size="1">
<i><br />For me, isolation via message passing sounds more interesting than transactional memory. It has&nbsp;proven useful for decades.<br /></i></td>
</tr>
</tbody>
</table>
</blockquote>
<br /><br />Why not have both?<br />In some cases message passing just doesn't work well at all. For example you may want 10000 objects to be able to query the same data (but only one or two of those objects of those modifies the data). Do you really want each to pass through a protocol with
 just a single thread &quot;owning&quot; that data? Sounds like a recipe for disaster w.r.t. performance to me. Transactions scale very well in situations like that (which is extremely common in practice), because each thread can do all the reading it wants to without
 interfering with the execution of any other threads.<br />...<br /></i></td>
</tr>
</tbody>
</table>
</blockquote>
<br /><br />I see what your saying, but lets analyze that.&nbsp; Essentially, that is a classic ReaderWriter lock sample.&nbsp; You need the sync, because you never know who the last action was, a reader or writer.&nbsp; So you still need some kind of sync primitive to protect the invariants.<br /><br />One may say, lets keep the message queue for writers, but let readers read properties directly. But here we have couple issues.&nbsp; You still need lock to insure atomic reads (i.e non cache and non torn).&nbsp; Second, you have possible coordination issues the runtime
 could never know and only your logic knows.&nbsp; For example, your object may intentionally not be popping the queue (sort of a working blocking operation) queue until it completes work for last task - as maybe order is important or maybe is waiting on various
 replies.&nbsp; There is all kinds of reasons order could be important and you can't reliably short circut that in general case.&nbsp; So only the Object knows best.&nbsp; As far as Perf goes, yes the message passing has some cost.&nbsp; But so do ReaderWriters and Monitors.&nbsp;
 When you look at the &quot;net&quot; performance, I think it probably is a wash or better with message passing.&nbsp; Costs such as complexity and correctness proof are much less from the start.&nbsp; There is many other benefits you can't get with locks or even trans memory.&nbsp;
 You can get order symatics, self messaging, throttling,&nbsp;naturally async, pipelining,&nbsp;natural composition, loose binding, and others.<br /><br />Think Juval Lowy nailed it here. Every class needs to be a service:<br /><a href="/ShowPost.aspx?PostID=349561#349561"><a href="http://channel9.msdn.com/ShowPost.aspx?PostID=349561#349561">http&#58;&#47;&#47;channel9.msdn.com&#47;ShowPost.aspx&#63;PostID&#61;349561&#35;349561</a></a></div>
</blockquote>
<br /><br />If you think about &quot;processes&quot; that are lighter than a thread, and do not need a stack, messages can possibly be as fast as ordinary method calls, with the added difficulty of enregistration of parameters. A stack is used to save the function call frames. A
 message queue saves message parameters. In terms of storage, there is not a big difference, it is primarily a question of creating a very fast queue and dispatching mechanism.&nbsp;<br /><br />I think it is best to assume the creators of erlang, scala, E, etc have or will address performance, and avoid assumptions about implementation or performance.
<br /><br />Just looking at the advantages, I agree with you, it is a great way to work.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390380720000000</link>
		<pubDate>Tue, 19 Feb 2008 17:14:32 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390380720000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">sylvan wrote:</div>
<div class="quoteBody">&#65279;
<blockquote>
<table class="quoteTable">
<tbody>
<tr>
<td valign="top" width="10"><img src="/Themes/AlmostGlass/images/icon-quote.gif"></td>
<td class="txt3"><strong>Frank Hileman wrote:</strong>
<hr size="1">
<i><br />For me, isolation via message passing sounds more interesting than transactional memory. It has&nbsp;proven useful for decades.<br /></i></td>
</tr>
</tbody>
</table>
</blockquote>
<br /><br />Why not have both?<br />In some cases message passing just doesn't work well at all. For example you may want 10000 objects to be able to query the same data (but only one or two of those objects of those modifies the data). Do you really want each to pass through a protocol with
 just a single thread &quot;owning&quot; that data? Sounds like a recipe for disaster w.r.t. performance to me. Transactions scale very well in situations like that (which is extremely common in practice), because each thread can do all the reading it wants to without
 interfering with the execution of any other threads.<br /><br />I agree that message passing is ideal <i>when suitable</i>, but sometimes it just isn't. Also, while threads are sometimes excellent abstractions (even for things where you *don't* care about concurrency they may be the right model), sometimes they just suck.
 They basically suffer from the same problem that &quot;goto&quot; does: obfuscation of the structure of the program (you have to jump back and forth through messages in different threads, which one may not be known until you run the program, to understand what the program
 does).<br /><br />Now I freely confess that I hadn't seen E (I'll look into it now) so if they give some new cool abstraction that solves all of this I'll recant my statements, but for now I'll say this: there is no one solution, we need multiple solutions to the problem of
 parallelism/concurrency. In my book the bara minimum is: Nested data parallelism, task-based (purely functional) parallelism, threads with messages, and threads with shared state (here's where you need transactions).<br /></div>
</blockquote>
<br /><br />In message oriented systems, erlang, scala, etc, the isolated, message passing units are more lightweight than threads. The idea is to get away from the traditional thread with its heavy stack. Message passing is a robust, proven way of isolating state, that
 can scale well. Most people believe message passing is easier than locks, which do not scale well. Message passing in conjunction with functional programming (erlang) has proven successful for difficult concurrent telecommunications applications.<br /><br />Transactions will always be needed for some types of applications, but transactional memory is a new thing, that to me, seems more of a hack to keep holding onto older ways of working.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390372720000000</link>
		<pubDate>Tue, 19 Feb 2008 17:01:12 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633390372720000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Burton Smith: On General Purpose Super Computing and the History and Future of Parallelism</title>
		<description>
			<![CDATA[Hi Charles,<br /><br />Thanks to you and Burton Smith for the conversation. I would like to hear more about anything at microsoft having to do with isolation via message passing and capability security, similar to the E language:<br /><br /><a href="http://www.erights.org/">http://www.erights.org/</a><br /><br />I know we have CCR, but the syntax is clumsy, messaging does not have first class status, nor is there any isolation. What kind of similar things to E are happening at Microsoft, if any?<br /><br />For me, isolation via message passing sounds more interesting than transactional memory. It has&nbsp;proven useful for decades.<br /><br />Thanks,<br />Frank<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633386817180000000</link>
		<pubDate>Fri, 15 Feb 2008 14:15:18 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Burton-Smith-On-General-Purpose-Super-Computing-and-the-History-and-Future-of-Parallelism#c633386817180000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer, Gilad Bracha, Mads Torgersen: Perspectives on Programming Language Design and Evolution</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">evildictaitor wrote:</div>
<div class="quoteBody">&#65279;
<blockquote>
<table class="quoteTable">
<tbody>
<tr>
<td valign="top" width="10"><img src="/Themes/AlmostGlass/images/icon-quote.gif"></td>
<td class="txt3"><strong>Frank Hileman wrote:</strong>
<hr size="1">
<i>&#65279;The Singualrity OS proved that inter-process communication, at least, can be faster when using a higher level language, as long as strict contracts are observed. This means drivers are best not written in a language such as c&#43;&#43;, since they are a critical
 part of the OS stack.</i></td>
</tr>
</tbody>
</table>
</blockquote>
<br /><br />Depends. If your operating system trusts the people who are writing the drivers (as has tended to be the case in the past) then languages such as C&#43;&#43; and C will almost invariably be at least as fast as anything written in C# or other high-level pointerless
 languages.<br /></div>
</blockquote>
<br /><br />Correct. But OS hangups and crashes do not promote trust among end users. The interesting thing about higher level languages and formal methods is the promise of static analysis to both improve reliablity and increase performance. Right now the emphasis is
 on safety, not performance, but that could change.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution#c633382549280000000</link>
		<pubDate>Sun, 10 Feb 2008 15:42:08 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution#c633382549280000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer, Gilad Bracha, Mads Torgersen: Perspectives on Programming Language Design and Evolution</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">aL_ wrote:</div>
<div class="quoteBody">&#65279;(i also think that while the clr isnt perfect, its unfair to say that the its &quot;severly limited&quot;)<br /></div>
</blockquote>
<br /><br />From the perspective of someone implementing a language on a virtual machine, the CLR, with its baked in notions of types and polymorphism, is more limited than a simpler VM adding only things like garbage collection and object encapsulation, leaving dispatch
 and other details to the language implementer. From that perspective the CLR is limited. MSIL is essentially C# in a lower level form, not a general purpose VM.<br /><br />Severely limited from the language implementer point of view, hence the DLR and other VMs since the CLR and JVM.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution#c633380904430000000</link>
		<pubDate>Fri, 08 Feb 2008 18:00:43 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution#c633380904430000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer, Gilad Bracha, Mads Torgersen: Perspectives on Programming Language Design and Evolution</title>
		<description>
			<![CDATA[The Singualrity OS proved that inter-process communication, at least, can be faster when using a higher level language, as long as strict contracts are observed. This means drivers are best not written in a language such as c&#43;&#43;, since they are a critical
 part of the OS stack.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution#c633380100290000000</link>
		<pubDate>Thu, 07 Feb 2008 19:40:29 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution#c633380100290000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Erik Meijer, Gilad Bracha, Mads Torgersen: Perspectives on Programming Language Design and Evolution</title>
		<description>
			<![CDATA[Thank you to all in the interview, and the interviewer. Gilad is <strong>not</strong> arrogant. His comments are&nbsp;right on target. He does not avoid strong opinions.
<br /><br />These videos reach a much larger audience than the people at a programming language conference. While some may react badly to criticisim of their favorite technology (i.e. severe limitations in the CLR), the videos are a wonderful way to spread ideas to the
 larger audience. It is a great way to do &quot;marketing&quot; for these ideas.<br /><p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution#c633379961870000000</link>
		<pubDate>Thu, 07 Feb 2008 15:49:47 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Erik-Meijer-Gilad-Bracha-Mads-Torgersen-Perspectives-on-Programming-Language-Design-and-Evolution#c633379961870000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: Everything you wanted to know about VC++ deployment but were afraid to ask</title>
		<description>
			<![CDATA[Thanks, littleguru. I assumed we were being forced to use a technology.<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Shows/Going+Deep/Everything-you-wanted-to-know-about-VC-deployment-but-were-afraid-to-ask#c633352280980000000</link>
		<pubDate>Sun, 06 Jan 2008 14:54:58 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Shows/Going+Deep/Everything-you-wanted-to-know-about-VC-deployment-but-were-afraid-to-ask#c633352280980000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: JAOO 2007: Joe Armstrong - On Erlang, OO, Concurrency, Shared State and the Future, Part 1</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">sylvan wrote:</div>
<div class="quoteBody">&#65279;<br />No language disallows side effects. Haskell is full of them!
<p>The difference is that in Haskell the side effects are contained within a pure type system. So even if you have small component somewhere that uses mutable state internally (e.g. some algorithms require mutable state!), the type system can keep track of
 that for you, and will refuse to let any of that mutable state &quot;leak&quot; out to the pure code. You can use side effects, but the compiler will force you to keep them separate from the bulk of the code (which doesn't have side effects).<br /></p>
</div>
</blockquote>
<br /><br />This is a great point! As I mentioned, this is closer to the original idea of object oriented programming, whereby an object's state is purely encapsulated. The original motivation behind OO was to view each object as a small computer in and of itself.
<p></p>
<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Blogs/Charles/JAOO-2007-Joe-Armstrong-On-Erlang-OO-Concurrency-Shared-State-and-the-Future-Part-1#c633295236620000000</link>
		<pubDate>Thu, 01 Nov 2007 14:21:02 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Blogs/Charles/JAOO-2007-Joe-Armstrong-On-Erlang-OO-Concurrency-Shared-State-and-the-Future-Part-1#c633295236620000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: JAOO 2007: Joe Armstrong - On Erlang, OO, Concurrency, Shared State and the Future, Part 1</title>
		<description>
			<![CDATA[
<p>duplicate post deleted <img src='http://ecn.channel9.msdn.com/o9/content/images/emoticons/emotion-7.gif' alt='Perplexed' /></p>
<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Blogs/Charles/JAOO-2007-Joe-Armstrong-On-Erlang-OO-Concurrency-Shared-State-and-the-Future-Part-1#c633294449580000000</link>
		<pubDate>Wed, 31 Oct 2007 16:29:18 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Blogs/Charles/JAOO-2007-Joe-Armstrong-On-Erlang-OO-Concurrency-Shared-State-and-the-Future-Part-1#c633294449580000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
	<item>
		<title>Re: JAOO 2007: Joe Armstrong - On Erlang, OO, Concurrency, Shared State and the Future, Part 1</title>
		<description>
			<![CDATA[
<blockquote>
<div class="quoteAuthor">staceyw wrote:</div>
<div class="quoteBody">&#65279; We can actually do this pretty easy with OO today.&nbsp; You can derive all objects from a class that has an in and out queue and a worker thread.&nbsp; Then send messages to it and it processes all messages in local scope if it wants.&nbsp; However,
 not sure this is better then some library (i.e. ccr, pfx) that takes lambdas and does the work inside a closure.&nbsp; With the ability to&nbsp;have&nbsp;nobs on the&nbsp;library for thread min/max, wait times, throttles, perf mon, etc.&nbsp;The former could be a good design for a
 pipeline server (i.e. sql), but I think the later is better for general work and things like joins, choice,&nbsp;futures, etc.&nbsp; Room for both I think.</div>
</blockquote>
<br /><br />I would qualify this:
<ol>
<li>A &quot;process&quot; in something like Erlang is more lightweight and transparent than a Thread in a traditional OO language/library such as C# -- you can create millions, and distribute them across networks easily.&nbsp;Libraries can do similar things but the distribution
 might be difficult without integrated support as in Erlang.&nbsp; </li><li>There is nothing in C# or the CLR to prevent modifying encapsulated state in an object, in the sense that every value returned from a function, and every property getter, needs to return something with value semantics, not reference semantics.
</li><li>In Erlang at least, the flow of control is generally turned inside out with the &quot;objects&quot; waiting for a message to arrive, rather than sending a message and waiting for an object to return. The .net framework libraries are generally not designed around
 this model.</li></ol>
<p>posted by Frank Hileman</p>]]>
		</description>
		<link>http://channel9.msdn.com/Blogs/Charles/JAOO-2007-Joe-Armstrong-On-Erlang-OO-Concurrency-Shared-State-and-the-Future-Part-1#c633294408010000000</link>
		<pubDate>Wed, 31 Oct 2007 15:20:01 GMT</pubDate>
		<guid isPermaLink="true">http://channel9.msdn.com/Blogs/Charles/JAOO-2007-Joe-Armstrong-On-Erlang-OO-Concurrency-Shared-State-and-the-Future-Part-1#c633294408010000000</guid>
		<dc:creator>Frank Hileman</dc:creator>
	</item>
</channel>
</rss>