<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" media="screen" href="/App_Themes/default/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:evnet="http://www.mscommunities.com/rssmodule/"><channel><title>Comment Feed for Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers (Going Deep on Channel 9)</title><atom:link rel="self" type="application/rss+xml" href="http://channel9.msdn.com/shows/going+deep/expert-to-expert-erik-meijer-and-bertrand-meyer-objects-contracts-concurrency-sleeping-barbers/rss/default.aspx" /><image><url>http://mschnlnine.vo.llnwd.net/d1/Dev/App_Themes/C9/images/feedimage.png</url><title>Comment Feed for Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers (Going Deep on Channel 9)</title><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/</link></image><description>Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers</description><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/</link><language>en-us</language><pubDate>Fri, 17 Oct 2008 12:27:57 GMT</pubDate><lastBuildDate>Fri, 17 Oct 2008 12:27:57 GMT</lastBuildDate><generator>EvNet (EvNet, Version=1.0.3599.6114, Culture=neutral, PublicKeyToken=null)</generator><item><title>Re: Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>Anyone who want to convert Mod video files to mpg, mpeg, avi, wmv video formats you can use Aiseesoft Mod Video Converter. You can free download it and have a try.&lt;BR&gt;&lt;A href="http://www.aiseesoft.com/mod-video-converter.html"&gt;http://www.aiseesoft.com/mod-video-converter.html&lt;/A&gt;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=433723</link><pubDate>Fri, 17 Oct 2008 12:27:57 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=433723</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/433723/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Anyone who want to convert Mod video files to mpg, mpeg, avi, wmv video formats you can use Aiseesoft Mod Video Converter. You can free download it and have a try.http://www.aiseesoft.com/mod-video-converter.html</evnet:previewtext><dc:creator>sulivan04</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/433723/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;P&gt;Very&amp;nbsp;good video. This was very nice to see Bertrand Meyer speaking about his work. Thanks for bringing this.&lt;/P&gt;
&lt;P&gt;BTW, does he have to take into account the customers who do not see a barber and walk away? That was very funny!! :D&lt;/P&gt;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=397601</link><pubDate>Sun, 06 Apr 2008 10:23:07 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=397601</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/397601/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Very&amp;nbsp;good video. This was very nice to see Bertrand Meyer speaking about his work. Thanks for bringing this.
BTW, does he have to take into account the customers who do not see a barber and walk away? That was very funny!! :D</evnet:previewtext><dc:creator>pierreleclercq</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/397601/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>Awesome video!!! Please more of this kind, more nerd food&amp;nbsp;:)</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=397256</link><pubDate>Wed, 02 Apr 2008 17:48:29 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=397256</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/397256/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Awesome video!!! Please more of this kind, more nerd food&amp;nbsp;:)</evnet:previewtext><dc:creator>Christian Liensberger</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/397256/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;foostar wrote:&lt;/div&gt;&lt;div&gt;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. &lt;BR&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;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?&lt;BR&gt;&lt;BR&gt;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.</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=397101</link><pubDate>Wed, 02 Apr 2008 03:40:36 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=397101</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/397101/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>foostar wrote: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&amp;#8230;</evnet:previewtext><dc:creator>Frank Hileman</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/397101/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>The participants seem surprisingly ignorant of the state of the art in concurrent programming. Message passing architectures are old hat, and have been shown to be scalable; a lot of work is going into transactionactional memory and other non-blocking strategies, and so on, but I don't hear these being mentioned even in passing.&lt;br&gt;&lt;br&gt;The Eiffel SCOOP mechanism was proposed over a decade ago, making the idea generations old in the software world, yet a functioning product still hasn't shipped. Why is that?&lt;br&gt;&lt;br&gt;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. &lt;br&gt;&lt;br&gt;Its one of those ideas that have a seductive elegance at first glance but ultimately turns into a dead end.&lt;br&gt;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=397052</link><pubDate>Tue, 01 Apr 2008 21:24:42 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=397052</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/397052/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>The participants seem surprisingly ignorant of the state of the art in concurrent programming. Message passing architectures are old hat, and have been shown to be scalable; a lot of work is going into transactionactional memory and other non-blocking strategies, and so on, but I don't hear these&amp;#8230;</evnet:previewtext><dc:creator>foostar</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/397052/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;dcharles wrote:&lt;/div&gt;&lt;div&gt;﻿Truely old school, he wrote his algorithm on paper! how many programmers do&amp;nbsp;that today?&lt;img src="http://channel9.msdn.com/emoticons/emotion-2.gifborder="&gt;&amp;nbsp;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br&gt;&lt;br&gt;Me for one. Excepting trivial functions, most of what I do requires me to think, and I can't do that without a bit of paper and a pencil.&lt;br&gt;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396561</link><pubDate>Mon, 31 Mar 2008 04:33:02 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396561</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396561/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>dcharles wrote:﻿Truely old school, he wrote his algorithm on paper! how many programmers do&amp;nbsp;that today?&amp;nbsp;Me for one. Excepting trivial functions, most of what I do requires me to think, and I can't do that without a bit of paper and a pencil.</evnet:previewtext><dc:creator>evildictaitor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396561/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;staceyw wrote:&lt;/div&gt;&lt;div&gt;﻿
&lt;BLOCKQUOTE&gt;
&lt;TABLE&gt;

&lt;TR&gt;
&lt;TD&gt;&lt;IMG src="http://channel9.msdn.com/Themes/AlmostGlass/images/icon-quote.gif&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;sokhaty wrote:&lt;/STRONG&gt;

&lt;I&gt;﻿ 
&lt;BLOCKQUOTE&gt;
&lt;TABLE&gt;

&lt;TR&gt;
&lt;TD&gt;&lt;IMG src="http://channel9.msdn.com/Themes/AlmostGlass/images/icon-quote.gif&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;staceyw wrote:&lt;/STRONG&gt; 

&lt;I&gt;﻿Here is a CCR implementation of the Sleeping Barber(s).&lt;BR&gt;Optionally, we can add barbers (threads).&lt;BR&gt;As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User level locks on shared state could still be needed in the&amp;nbsp;lambda.&amp;nbsp; So it is not something that has to be "baked" into a language itself as this works pretty clean as a library.&lt;BR&gt;&lt;BR&gt;I really like a few of ideas in this video in general:&lt;BR&gt;1)&amp;nbsp;I like the ccr Port abstraction. For some reason I like endpoints and messages.&lt;BR&gt;2) I like the idea of Pre and Post conditions. This could be added to c#. Think spec# has.&lt;BR&gt;3) I like the idea explicit handling of Query and Command on shared state.&amp;nbsp; It allows tooling and static and runtime checks.&lt;BR&gt;4) I like the idea un-named types like Tuples. c# has anonymous types, but you can't pass them around.&lt;BR&gt;5) I love the idea of Transactions for object state and have them work with normal DB transactions for rollback.&amp;nbsp; That seems to be a winning pattern for handling shared state and something like CCR below for handling concurrency and coordination.&lt;BR&gt;&lt;BR&gt;private void button20_Click(object sender, EventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Have 1 Barber and N chairs. You can add Barbers (i.e. Threads in the pool) by changing the Dispatcher ctor.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port&amp;lt;string&amp;gt; chairsPort = new Port&amp;lt;string&amp;gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DispatcherQueue dq = new DispatcherQueue("Barber", new Dispatcher(1, "BarberPool"));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Arbiter.Activate(dq, Arbiter.Receive(true, chairsPort, (string name) =&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.Sleep(100); // Time to cut hair.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Customer {0} thanks the barber for the cut on thread {1}.", name, Thread.CurrentThread.ManagedThreadId);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 15; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chairsPort.Post("Customer" + i);&lt;BR&gt;}&lt;/I&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;Well, it looks to me that support&amp;nbsp;for&amp;nbsp;Queries and Commands would (almost) automatically require transactional support.&lt;BR&gt;No one would like to read partial state, would they?&lt;BR&gt;And in a way, it proves&amp;nbsp;the point of functional programmers are trying to make - when you need to change the world, you have to create a new copy of it.&lt;BR&gt;Whoever was reading the world at the moment you decided to modify it, would continue to use the "old" consistent version of it.&lt;BR&gt;After you are done changing the world and committed your changes, all the new&amp;nbsp;readers would see the&amp;nbsp;new updated version. The old version will hang around long enough for all active readers conclude their activities and be "garbage collected" as soon as its no longer required.&lt;BR&gt;Which is sort of what databases already do to implement non-blocking consistent reads.&lt;BR&gt;So, it seems that eventually runtime environment will be a database with a common VM on top of it.&lt;BR&gt;But that approach has its own issues, namely a requirement to have universal change sequence number to mark world versions.&lt;BR&gt;&lt;BR&gt;Hmmm, is it a coincidence that Eric Meijer is said to be working on SQL Server these days?&lt;BR&gt;&lt;/I&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;BR&gt;yes.&amp;nbsp; That is essentially what we came up with in another thread on object transactions.&amp;nbsp; Transactions would atomically make a copy of the invariants.&amp;nbsp; A writer could make updates to its' version and "try" update.&amp;nbsp; I think it would a ~simple matter to extent object meta data to include a seq number.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;BR&gt;Interesting idea. Thanks for sharing.&lt;BR&gt;&lt;BR&gt;Keep on GoodThinking,&lt;BR&gt;C</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396558</link><pubDate>Mon, 31 Mar 2008 03:52:02 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396558</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396558/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>staceyw wrote:﻿





sokhaty wrote:

﻿ 





staceyw wrote: 

﻿Here is a CCR implementation of the Sleeping Barber(s).Optionally, we can add barbers (threads).As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User&amp;#8230;</evnet:previewtext><dc:creator>Charles</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396558/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;sokhaty wrote:&lt;/div&gt;&lt;div&gt;﻿
&lt;BLOCKQUOTE&gt;
&lt;TABLE&gt;

&lt;TR&gt;
&lt;TD&gt;&lt;IMG src="http://channel9.msdn.com/Themes/AlmostGlass/images/icon-quote.gif&gt;&lt;/TD&gt;
&lt;TD&gt;&lt;STRONG&gt;staceyw wrote:&lt;/STRONG&gt;

&lt;I&gt;﻿Here is a CCR implementation of the Sleeping Barber(s).&lt;BR&gt;Optionally, we can add barbers (threads).&lt;BR&gt;As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User level locks on shared state could still be needed in the&amp;nbsp;lambda.&amp;nbsp; So it is not something that has to be "baked" into a language itself as this works pretty clean as a library.&lt;BR&gt;&lt;BR&gt;I really like a few of ideas in this video in general:&lt;BR&gt;1)&amp;nbsp;I like the ccr Port abstraction. For some reason I like endpoints and messages.&lt;BR&gt;2) I like the idea of Pre and Post conditions. This could be added to c#. Think spec# has.&lt;BR&gt;3) I like the idea explicit handling of Query and Command on shared state.&amp;nbsp; It allows tooling and static and runtime checks.&lt;BR&gt;4) I like the idea un-named types like Tuples. c# has anonymous types, but you can't pass them around.&lt;BR&gt;5) I love the idea of Transactions for object state and have them work with normal DB transactions for rollback.&amp;nbsp; That seems to be a winning pattern for handling shared state and something like CCR below for handling concurrency and coordination.&lt;BR&gt;&lt;BR&gt;private void button20_Click(object sender, EventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Have 1 Barber and N chairs. You can add Barbers (i.e. Threads in the pool) by changing the Dispatcher ctor.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port&amp;lt;string&amp;gt; chairsPort = new Port&amp;lt;string&amp;gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DispatcherQueue dq = new DispatcherQueue("Barber", new Dispatcher(1, "BarberPool"));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Arbiter.Activate(dq, Arbiter.Receive(true, chairsPort, (string name) =&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.Sleep(100); // Time to cut hair.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Customer {0} thanks the barber for the cut on thread {1}.", name, Thread.CurrentThread.ManagedThreadId);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 15; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chairsPort.Post("Customer" + i);&lt;BR&gt;}&lt;/I&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TABLE&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;Well, it looks to me that support&amp;nbsp;for&amp;nbsp;Queries and Commands would (almost) automatically require transactional support.&lt;BR&gt;No one would like to read partial state, would they?&lt;BR&gt;And in a way, it proves&amp;nbsp;the point of functional programmers are trying to make - when you need to change the world, you have to create a new copy of it.&lt;BR&gt;Whoever was reading the world at the moment you decided to modify it, would continue to use the "old" consistent version of it.&lt;BR&gt;After you are done changing the world and committed your changes, all the new&amp;nbsp;readers would see the&amp;nbsp;new updated version. The old version will hang around long enough for all active readers conclude their activities and be "garbage collected" as soon as its no longer required.&lt;BR&gt;Which is sort of what databases already do to implement non-blocking consistent reads.&lt;BR&gt;So, it seems that eventually runtime environment will be a database with a common VM on top of it.&lt;BR&gt;But that approach has its own issues, namely a requirement to have universal change sequence number to mark world versions.&lt;BR&gt;&lt;BR&gt;Hmmm, is it a coincidence that Eric Meijer is said to be working on SQL Server these days?&lt;BR&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;BR&gt;yes.&amp;nbsp; That is essentially what we came up with in another thread on object transactions.&amp;nbsp; Transactions would atomically make a copy of the invariants.&amp;nbsp; A writer could make updates to its' version and "try" update.&amp;nbsp; I think it would a ~simple matter to extent object meta data to include a seq number.</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396521</link><pubDate>Sun, 30 Mar 2008 23:38:42 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396521</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396521/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>sokhaty wrote:﻿





staceyw wrote:

﻿Here is a CCR implementation of the Sleeping Barber(s).Optionally, we can add barbers (threads).As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User level locks on shared state could&amp;#8230;</evnet:previewtext><dc:creator>William Stacey</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396521/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;dcharles wrote:&lt;/div&gt;&lt;div&gt;﻿Truely old school, he wrote his algorithm on paper! how many programmers do&amp;nbsp;that today?&lt;IMG src="http://channel9.msdn.com/emoticons/emotion-2.gifborder=0&gt;&amp;nbsp;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;BR&gt;I used to write all my Cobol programs on paper first and work them out and debug them on paper.&amp;nbsp; This was mainly because we had time limit on input and Run time for CPU.&amp;nbsp; It actually worked out pretty well, because you could sit down and type the whole program in an hour or so and it was mostly debugged already.&amp;nbsp; I would not do that today.&amp;nbsp; As Erik has said before, today the IDE is so good, it is like "smart paper" that serves the same function as paper, but with other benefits.</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396518</link><pubDate>Sun, 30 Mar 2008 23:28:51 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396518</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396518/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>dcharles wrote:﻿Truely old school, he wrote his algorithm on paper! how many programmers do&amp;nbsp;that today?&amp;nbsp;I used to write all my Cobol programs on paper first and work them out and debug them on paper.&amp;nbsp; This was mainly because we had time limit on input and Run time for CPU.&amp;nbsp; It&amp;#8230;</evnet:previewtext><dc:creator>William Stacey</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396518/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;dot_tom wrote:&lt;/div&gt;&lt;div&gt;﻿
&lt;P&gt;Once again this video made me think of a really cool addition I'd love to see Channel 9 add to such video interviews. Charles, is there any chance you could ask your interviewees to state the last comp.sci book they read and enjoyed? I'm thinking the 'tradition' would be that it wouldn't even directly have to have anything to do with the subject of the video in question. You could then include the book&amp;nbsp;details in addition to the usual interviewee home page link. Often times when watching or listening to the folks you interview I'm left thinking: 'Wow, I'd love the scan the titles on their technical bookshelf!'. Am I alone in this? :-)&lt;/P&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;BR&gt;That's a fine idea, dot_tom! Thanks for the suggestion.&lt;BR&gt;C</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396505</link><pubDate>Sun, 30 Mar 2008 22:15:05 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396505</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396505/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>dot_tom wrote:﻿
Once again this video made me think of a really cool addition I'd love to see Channel 9 add to such video interviews. Charles, is there any chance you could ask your interviewees to state the last comp.sci book they read and enjoyed? I'm thinking the 'tradition' would be that it&amp;#8230;</evnet:previewtext><dc:creator>Charles</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396505/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>Hi DCharles. I'm guilty of frequently resorting paper based coding! :-) I keep meaning to get myself a cheap A4 scanner so I can archive these things. I often make myself walk away from my computer and go think somewhere else. Which usually results in algorthims being sketched on any available bit of paper. I often find it much easier to do 'think refactors' on paper than on the screen.</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396343</link><pubDate>Sun, 30 Mar 2008 08:00:51 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396343</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396343/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Hi DCharles. I'm guilty of frequently resorting paper based coding! :-) I keep meaning to get myself a cheap A4 scanner so I can archive these things. I often make myself walk away from my computer and go think somewhere else. Which usually results in algorthims being sketched on any available bit&amp;#8230;</evnet:previewtext><dc:creator>Tom Kirby-Green</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396343/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;P&gt;Once again this video made me think of a really cool addition I'd love to see Channel 9 add to such video interviews. Charles, is there any chance you could ask your interviewees to state the last comp.sci book they read and enjoyed? I'm thinking the 'tradition' would be that it wouldn't even directly have to have anything to do with the subject of the video in question. You could then include the book&amp;nbsp;details in addition to the usual interviewee home page link. Often times when watching or listening to the folks you interview I'm left thinking: 'Wow, I'd love the scan the titles on their technical bookshelf!'. Am I alone in this? :-)&lt;/P&gt;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396342</link><pubDate>Sun, 30 Mar 2008 07:54:14 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396342</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396342/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Once again this video made me think of a really cool addition I'd love to see Channel 9 add to such video interviews. Charles, is there any chance you could ask your interviewees to state the last comp.sci book they read and enjoyed? I'm thinking the 'tradition' would be that it wouldn't even&amp;#8230;</evnet:previewtext><dc:creator>Tom Kirby-Green</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396342/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>Truely old school, he wrote his algorithm on paper! how many programmers do&amp;nbsp;that today?:D&amp;nbsp;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396238</link><pubDate>Sat, 29 Mar 2008 22:40:02 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396238</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396238/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Truely old school, he wrote his algorithm on paper! how many programmers do&amp;nbsp;that today?:D&amp;nbsp;</evnet:previewtext><dc:creator>dcharles</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396238/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>Erik does in fact work on the same team that makes SQL Server (and other data-related technologies), which is a large and varied team, but he does not work on SQL Server specifically. Erik is first and foremost a language guru and his recent work was instrumental in making language&amp;nbsp;features like LINQ possible (among other new functional-based constructs in C# and VB.NET). He's also the chief architect of Volta.&lt;BR&gt;&lt;BR&gt;The Data Programmability team is full of innovators. Erik is one of them.&lt;BR&gt;&lt;BR&gt;C</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396194</link><pubDate>Sat, 29 Mar 2008 19:31:52 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396194</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396194/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Erik does in fact work on the same team that makes SQL Server (and other data-related technologies), which is a large and varied team, but he does not work on SQL Server specifically. Erik is first and foremost a language guru and his recent work was instrumental in making language&amp;nbsp;features&amp;#8230;</evnet:previewtext><dc:creator>Charles</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396194/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;staceyw wrote:&lt;/div&gt;&lt;div&gt;﻿Here is a CCR implementation of the Sleeping Barber(s).&lt;BR&gt;Optionally, we can add barbers (threads).&lt;BR&gt;As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User level locks on shared state could still be needed in the&amp;nbsp;lambda.&amp;nbsp; So it is not something that has to be "baked" into a language itself as this works pretty clean as a library.&lt;BR&gt;&lt;BR&gt;I really like a few of ideas in this video in general:&lt;BR&gt;1)&amp;nbsp;I like the ccr Port abstraction. For some reason I like endpoints and messages.&lt;BR&gt;2) I like the idea of Pre and Post conditions. This could be added to c#. Think spec# has.&lt;BR&gt;3) I like the idea explicit handling of Query and Command on shared state.&amp;nbsp; It allows tooling and static and runtime checks.&lt;BR&gt;4) I like the idea un-named types like Tuples. c# has anonymous types, but you can't pass them around.&lt;BR&gt;5) I love the idea of Transactions for object state and have them work with normal DB transactions for rollback.&amp;nbsp; That seems to be a winning pattern for handling shared state and something like CCR below for handling concurrency and coordination.&lt;BR&gt;&lt;BR&gt;private void button20_Click(object sender, EventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Have 1 Barber and N chairs. You can add Barbers (i.e. Threads in the pool) by changing the Dispatcher ctor.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port&amp;lt;string&amp;gt; chairsPort = new Port&amp;lt;string&amp;gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DispatcherQueue dq = new DispatcherQueue("Barber", new Dispatcher(1, "BarberPool"));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Arbiter.Activate(dq, Arbiter.Receive(true, chairsPort, (string name) =&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.Sleep(100); // Time to cut hair.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Customer {0} thanks the barber for the cut on thread {1}.", name, Thread.CurrentThread.ManagedThreadId);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 15; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chairsPort.Post("Customer" + i);&lt;BR&gt;}&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;Well, it looks to me that support&amp;nbsp;for&amp;nbsp;Queries and Commands would (almost) automatically require transactional support.&lt;BR&gt;No one would like to read partial state, would they?&lt;BR&gt;And in a way, it proves&amp;nbsp;the point of functional programmers are trying to make - when you need to change the world, you have to create a new copy of it.&lt;BR&gt;Whoever was reading the world at the moment you decided to modify it, would continue to use the "old" consistent version of it.&lt;BR&gt;After you are done changing the world and committed your changes, all the new&amp;nbsp;readers would see the&amp;nbsp;new updated version. The old version will hang around long enough for all active readers conclude their activities and be "garbage collected" as soon as its no longer required.&lt;BR&gt;Which is sort of what databases already do to implement non-blocking consistent reads.&lt;BR&gt;So, it seems that eventually runtime environment will be a database with a common VM on top of it.&lt;BR&gt;But that approach has its own issues, namely a requirement to have universal change sequence number to mark world versions.&lt;BR&gt;&lt;BR&gt;Hmmm, is it a coincidence that Eric Meijer is said to be working on SQL Server these days?&lt;BR&gt;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396061</link><pubDate>Sat, 29 Mar 2008 03:13:54 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396061</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396061/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>staceyw wrote:﻿Here is a CCR implementation of the Sleeping Barber(s).Optionally, we can add barbers (threads).As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User level locks on shared state could still be needed in&amp;#8230;</evnet:previewtext><dc:creator>sokhaty</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396061/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>Very interesting video - as all of these Going Deep's have been.&lt;BR&gt;&lt;BR&gt;RE&amp;nbsp;the Sleeping Barber: Why not just temporarily&amp;nbsp;impart the knowledge and know-how of how to cut one's own hair to each customer that comes along with instructions to come back and report how it went?&amp;nbsp;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396003</link><pubDate>Fri, 28 Mar 2008 19:13:10 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=396003</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/396003/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Very interesting video - as all of these Going Deep's have been.RE&amp;nbsp;the Sleeping Barber: Why not just temporarily&amp;nbsp;impart the knowledge and know-how of how to cut one's own hair to each customer that comes along with instructions to come back and report how it went?&amp;nbsp;</evnet:previewtext><dc:creator>martin_hughes</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/396003/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>Here is a CCR implementation of the Sleeping Barber(s).&lt;BR&gt;Optionally, we can add barbers (threads).&lt;BR&gt;As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User level locks on shared state could still be needed in the&amp;nbsp;lambda.&amp;nbsp; So it is not something that has to be "baked" into a language itself as this works pretty clean as a library.&lt;BR&gt;&lt;BR&gt;I really like a few of ideas in this video in general:&lt;BR&gt;1)&amp;nbsp;I like the ccr Port abstraction. For some reason I like endpoints and messages.&lt;BR&gt;2) I like the idea of Pre and Post conditions. This could be added to c#. Think spec# has.&lt;BR&gt;3) I like the idea explicit handling of Query and Command on shared state.&amp;nbsp; It allows tooling and static and runtime checks.&lt;BR&gt;4) I like the idea un-named types like Tuples. c# has anonymous types, but you can't pass them around.&lt;BR&gt;5) I love the idea of Transactions for object state and have them work with normal DB transactions for rollback.&amp;nbsp; That seems to be a winning pattern for handling shared state and something like CCR below for handling concurrency and coordination.&lt;BR&gt;&lt;BR&gt;private void button20_Click(object sender, EventArgs e)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Have 1 Barber and N chairs. You can add Barbers (i.e. Threads in the pool) by changing the Dispatcher ctor.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Port&amp;lt;string&amp;gt; chairsPort = new Port&amp;lt;string&amp;gt;();&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; DispatcherQueue dq = new DispatcherQueue("Barber", new Dispatcher(1, "BarberPool"));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Arbiter.Activate(dq, Arbiter.Receive(true, chairsPort, (string name) =&amp;gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Thread.Sleep(100); // Time to cut hair.&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Console.WriteLine("Customer {0} thanks the barber for the cut on thread {1}.", name, Thread.CurrentThread.ManagedThreadId);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }));&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (int i = 0; i &amp;lt; 15; i++)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; chairsPort.Post("Customer" + i);&lt;BR&gt;}</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395951</link><pubDate>Fri, 28 Mar 2008 15:12:22 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395951</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/395951/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Here is a CCR implementation of the Sleeping Barber(s).Optionally, we can add barbers (threads).As shown, this is actually a pretty clean pattern using Ports and lamdas and hides the locks and such in the runtime. User level locks on shared state could still be needed in the&amp;nbsp;lambda.&amp;nbsp; So it&amp;#8230;</evnet:previewtext><dc:creator>William Stacey</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/395951/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>I enjoyed this. Thanks</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395833</link><pubDate>Fri, 28 Mar 2008 07:41:00 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395833</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/395833/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>I enjoyed this. Thanks</evnet:previewtext><dc:creator>Jonathan Merriweather</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/395833/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;dot_tom wrote:&lt;/div&gt;&lt;div&gt;﻿Wow. 2008 is shaping up to be the best year to date for video interviews on Channel 9! How are you guys going to top this? :-)&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;BR&gt;There have been both hits and misses. 2007 was not the best year for channel9 videos. But you are right 2008 looks very promising: more videos on language, tools and process (development methods like Agile). A video about the new work item types in Rosario would be great...</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395829</link><pubDate>Fri, 28 Mar 2008 06:54:31 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395829</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/395829/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>dot_tom wrote:﻿Wow. 2008 is shaping up to be the best year to date for video interviews on Channel 9! How are you guys going to top this? :-)There have been both hits and misses. 2007 was not the best year for channel9 videos. But you are right 2008 looks very promising: more videos on language,&amp;#8230;</evnet:previewtext><dc:creator>Klaus Enevoldsen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/395829/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>Wow. 2008 is shaping up to be the best year to date for video interviews on Channel 9! How are you guys going to top this? :-)</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395823</link><pubDate>Fri, 28 Mar 2008 05:13:37 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395823</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/395823/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>Wow. 2008 is shaping up to be the best year to date for video interviews on Channel 9! How are you guys going to top this? :-)</evnet:previewtext><dc:creator>Tom Kirby-Green</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/395823/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;img src="http://channel9.msdn.com/Themes/AlmostGlass/images/icon-quote.gif&gt;&lt;/td&gt;&lt;td&gt;&lt;strong&gt;jason818_253.33 wrote:&lt;/strong&gt;&lt;i&gt;﻿ 
&lt;p&gt;Regarding the Sleeping Barber Algorithm and with out breaking the demonstration. Wouldn’t you want to have as many barbers as you have chairs?&lt;/p&gt;&lt;/i&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;br&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;CRPietschmann wrote:&lt;/div&gt;&lt;div&gt;﻿This analogy does make the problem sound simple.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;br&gt;&lt;br&gt;You've both misunderstood the crux of the &lt;a href="http://en.wikipedia.org/wiki/Sleeping_barber_problem"&gt;Sleeping Barber&lt;/a&gt; problem. The problem is a problem not of speed or efficiency, but one of concurrency. The point is to serve the customers without experiencing process- (customer-) starvation or deadlock and the Sleeping Barber problem is a double-rendevous problem requring a more careful use of locks to achieve the correct result than you might think at first.&lt;br&gt;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395773</link><pubDate>Fri, 28 Mar 2008 01:30:41 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395773</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/395773/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>jason818_253.33 wrote:﻿ 
Regarding the Sleeping Barber Algorithm and with out breaking the demonstration. Wouldn’t you want to have as many barbers as you have chairs?CRPietschmann wrote:﻿This analogy does make the problem sound simple.You've both misunderstood the crux of the Sleeping Barber&amp;#8230;</evnet:previewtext><dc:creator>evildictaitor</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/395773/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;jason818_253.33 wrote:&lt;/div&gt;&lt;div&gt;﻿ 
&lt;P&gt;Regarding the Sleeping Barber Algorithm and with out breaking the demonstration. Wouldn’t you want to have as many barbers as you have chairs?&lt;/P&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;BR&gt;&lt;BR&gt;This does inspire some thought.&lt;BR&gt;&lt;BR&gt;Basically, a chair will contain a customer, and a barber is required to do the work. This pretty much means that the number of chairs is the number of slots in the queue. The number of barbers will be determined by how many processor cores you have.&lt;BR&gt;&lt;BR&gt;So pretty much, the more processor cores you have, the more barbers you can have. You ideally want one barber for each processor core.&amp;nbsp;So, the more processor cores you have&amp;nbsp;and therefore the&amp;nbsp;more barbers you have, the faster you'll be able to cut the hair of all the customers in the chairs.&lt;BR&gt;&lt;BR&gt;This analogy does make the problem sound simple.</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395764</link><pubDate>Fri, 28 Mar 2008 00:00:17 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395764</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/395764/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>jason818_253.33 wrote:﻿ 
Regarding the Sleeping Barber Algorithm and with out breaking the demonstration. Wouldn’t you want to have as many barbers as you have chairs?This does inspire some thought.Basically, a chair will contain a customer, and a barber is required to do the work. This pretty much&amp;#8230;</evnet:previewtext><dc:creator>Chris Pietschmann</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/395764/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>&lt;p&gt;“I don’t use the internet any more because they can steel
every thing” in context that was a very funny comment. &lt;br&gt;&lt;/p&gt;&lt;p&gt;Regarding the Sleeping
Barber Algorithm and with out breaking the demonstration. Wouldn’t you
want to have as many barbers as you have chairs?&lt;/p&gt;</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395683</link><pubDate>Thu, 27 Mar 2008 20:56:19 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395683</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/395683/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>“I don’t use the internet any more because they can steel
every thing” in context that was a very funny comment. Regarding the Sleeping
Barber Algorithm and with out breaking the demonstration. Wouldn’t you
want to have as many barbers as you have chairs?</evnet:previewtext><dc:creator>jason818_253.33</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/395683/Trackback.aspx</trackback:ping></item><item><title>Re: Expert to Expert: Erik Meijer and Bertrand Meyer - Objects, Contracts, Concurrency, Sleeping Barbers and Eiffel</title><description>HOLY CRAP! I have to watch this!</description><comments></comments><link>http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395644</link><pubDate>Thu, 27 Mar 2008 18:48:15 GMT</pubDate><guid isPermaLink="false">http://channel9.msdn.com/shows/Going+Deep/Expert-to-Expert-Erik-Meijer-and-Bertrand-Meyer-Objects-Contracts-Concurrency-Sleeping-Barbers/?CommentID=395644</guid><evnet:views>0</evnet:views><evnet:viewtrackingurl>http://channel9.msdn.com/395644/WebViewBug.aspx?EVT=0</evnet:viewtrackingurl><evnet:previewtext>HOLY CRAP! I have to watch this!</evnet:previewtext><dc:creator>Bent Rasmussen</dc:creator><slash:comments>0</slash:comments><wfw:commentRss></wfw:commentRss><trackback:ping>http://channel9.msdn.com/395644/Trackback.aspx</trackback:ping></item></channel></rss>