<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="http://www.codeplex.com/rss.xsl"?><rss version="2.0"><channel><title>Port Concurrency Runtime (PCR)</title><link>http://pcr.codeplex.com/Project/ProjectRss.aspx</link><description>An asynchronous concurrency library using a port and message passing abstraction.</description><item><title>New Post: Is this project still alive?</title><link>http://pcr.codeplex.com/Thread/View.aspx?ThreadId=14114</link><description>&lt;div style="line-height: normal;"&gt;If the CCR is moved to .NET 4 library, it will leave out anyone who is using the IDE less than 2010.&amp;nbsp; I think that is a lot now.&lt;br&gt;
&lt;/div&gt;</description><author>blessyahu</author><pubDate>Tue, 28 Apr 2009 22:45:04 GMT</pubDate><guid isPermaLink="false">New Post: Is this project still alive? 20090428104504P</guid></item><item><title>New Post: Is this project still alive?</title><link>http://pcr.codeplex.com/Thread/View.aspx?ThreadId=14114</link><description>&lt;div style="line-height: normal;"&gt;Still here.  Have not updated in a while.  With CCR moving to a library and then probably some form in the Fx, I will have to see what direction this could go without overlapping current offerings.
&lt;/div&gt;</description><author>staceyw</author><pubDate>Thu, 02 Apr 2009 04:45:06 GMT</pubDate><guid isPermaLink="false">New Post: Is this project still alive? 20090402044506A</guid></item><item><title>NEW POST: Is this project still alive?</title><link>http://www.codeplex.com/PCR/Thread/View.aspx?ThreadId=14114</link><description>&lt;div class="wikidoc"&gt;
Haven't seen any activity since January.&lt;br /&gt; &lt;br /&gt;Karl&lt;br /&gt;
&lt;/div&gt;</description><author>kwaclaw</author><pubDate>Tue, 21 Aug 2007 15:58:54 GMT</pubDate><guid isPermaLink="false">NEW POST: Is this project still alive? 20070821035854P</guid></item><item><title>NEW POST: Managed IOCP &amp; ACB</title><link>http://www.codeplex.com/PCR/Thread/View.aspx?ThreadId=12586</link><description>&lt;div class="wikidoc"&gt;
Hi,&lt;br /&gt; &lt;br /&gt;I saw PCR recently and wanted the guys using PCR to take a look at my own concurrency libraries for .Net community. My libraries won Article of the Month award for Oct' 2006 and had clear design patterns for multi-threaded and asynchronous applications. These libraries come with lock-free implementations that provide good performance for server side applications. Moreover I tried to put pretty good documentation for these libraries, which are available as articles on CodeProject.com.&lt;br /&gt; &lt;br /&gt;My intention of this post is only informational.&lt;br /&gt; &lt;br /&gt;Here are the links to my articles and libraries.&lt;br /&gt; &lt;br /&gt;1. Asynchronous Code Blocks &lt;br /&gt;http://www.codeproject.com/cs/library/AsynchronousCodeBlocks.asp&lt;br /&gt; &lt;br /&gt;2. Managed I/O Completion Ports (IOCP)&lt;br /&gt;http://www.codeproject.com/cs/library/managediocp.asp&lt;br /&gt; &lt;br /&gt;3. Managed I/O Completion Ports (IOCP) - Part 2&lt;br /&gt;http://www.codeproject.com/cs/library/managediocp-part-2.asp&lt;br /&gt; &lt;br /&gt;Regards,&lt;br /&gt; &lt;br /&gt;Adityanand Pasumarthi&lt;br /&gt;
&lt;/div&gt;</description><author>adityapasumarthi</author><pubDate>Sat, 14 Jul 2007 04:03:22 GMT</pubDate><guid isPermaLink="false">NEW POST: Managed IOCP &amp; ACB 20070714040322A</guid></item><item><title>NEW POST: Sample: Chat</title><link>http://www.codeplex.com/PCR/Thread/View.aspx?ThreadId=3436</link><description>&lt;div class="wikidoc"&gt;
sorry to post again, but someone actually articulated the issue very well on a news group about IOCP... nobody shows any examples of actually writing data back to a client. which is the bit I'm a little frustrated with. Not to do with your library in particular, but it's a screwey scenario in basically all situations that would use IOCP.  I think Winsock accounts for this by offering AcceptEx with the native call, but as far as I can see there isn't an equivalent nice (not that AcceptEx makes it all that much clearer) way to do this in the CLR because it's such a new idea, and basically doing this in managed code virtualizes the whole process so the native implementation may not only be painful, but actually counter productive, exposing one to the preemptive nature of the native IOCP stuff.  Does that help make what I'm getting at any clearer? I hope so.&lt;br /&gt;
&lt;/div&gt;</description><author>aldousd666</author><pubDate>Fri, 13 Jul 2007 03:29:51 GMT</pubDate><guid isPermaLink="false">NEW POST: Sample: Chat 20070713032951A</guid></item><item><title>NEW POST: Sample: Chat</title><link>http://www.codeplex.com/PCR/Thread/View.aspx?ThreadId=3436</link><description>&lt;div class="wikidoc"&gt;
That is pretty neat, and it's close to what I'm trying to get to. But what if I want each client only to receive it's own messages... how would I sequence this, do I just use the shared storage like this and have them all filter for a key... that might be a little too chatty for something like a data engine.  I just can't get my head around how I'd be able to take advantage of asynch operations in a client server scenario, though it all makes complete sense when you're printing stuff to the console and broadcasting, I'm just missing the last piece. I'm sure I'm not the only one.  Can you please enlighten?&lt;br /&gt;
&lt;/div&gt;</description><author>aldousd666</author><pubDate>Thu, 12 Jul 2007 04:03:16 GMT</pubDate><guid isPermaLink="false">NEW POST: Sample: Chat 20070712040316A</guid></item><item><title>UPDATED WIKI: FAQ</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=FAQ&amp;version=20</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
PCR FAQ
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Why%20PCR%3f&amp;amp;referringTitle=FAQ"&gt;Why PCR?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=When%20did%20the%20PCR%20become%20self%20aware%3f&amp;amp;referringTitle=FAQ"&gt;When did the PCR become self aware?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Port%3f&amp;amp;referringTitle=FAQ"&gt;What is a Port?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Selector%3f&amp;amp;referringTitle=FAQ"&gt;What is a Selector?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Can%20I%20update%20UI%20with%20PCR%3f&amp;amp;referringTitle=FAQ"&gt;Can I update UI with PCR?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20is%20this%20similar%20to%20events%3f&amp;amp;referringTitle=FAQ"&gt;How is this similar to events?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=The%20Source%20Readme%3f&amp;amp;referringTitle=FAQ"&gt;The Source Readme?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20does%20locking%20work%3f&amp;amp;referringTitle=FAQ"&gt;How does locking work?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20closure%3f&amp;amp;referringTitle=FAQ"&gt;What is a closure?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Coroutine%3f&amp;amp;referringTitle=FAQ"&gt;What is a Coroutine?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=When%20is%20port%20processed%20FIFO%20or%20not%3f&amp;amp;referringTitle=FAQ"&gt;When is port processed FIFO or not?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20to%20create%20a%20task%20scheduler%3f&amp;amp;referringTitle=FAQ"&gt;How to create a task scheduler?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Can%20I%20do%20recursion%3f&amp;amp;referringTitle=FAQ"&gt;Can I do recursion?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Is%20there%20a%20Mono%20port%3f&amp;amp;referringTitle=FAQ"&gt;Is there a Mono port?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Cool%20comments%20from%20devs&amp;amp;referringTitle=FAQ"&gt;Cool comments from devs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Fri, 16 Mar 2007 16:39:19 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: FAQ 20070316043919P</guid></item><item><title>UPDATED WIKI: What is a Selector?</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=What is a Selector?&amp;version=5</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;What is a Selector?&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;The best way to think about selectors is with an analogy. A selector is like a query on a collection of objects in a port. If the query matches, the item(s) are removed from the port and the selector is run asyncronously. Using this thinking, a port is the table, the port items are the rows, and a Selector is the SQL query.&lt;br /&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Fri, 16 Mar 2007 16:34:41 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: What is a Selector? 20070316043441P</guid></item><item><title>NEW POST: How many threads, and how distributed?</title><link>http://www.codeplex.com/PCR/Thread/View.aspx?ThreadId=7543</link><description>&lt;div class="wikidoc"&gt;
&amp;quot;The major issue that I keep coming up against is how the work is assigned to a thread. The .NET thread pool doesn't strike me as the right approach because worker threads are intended to get in and get out quickly. So, a different threading model is required. But it also begs the question, what kind of infrastructure would be needed to deal with issues such as thread creation and processor utilization?&amp;quot;&lt;br /&gt; &lt;br /&gt;In the general case, the TP works pretty well.  As you point out, most cases, you don't want to start a thread per work item, as if that was desired, you would not need any of this and could just start threads passing ThreadStart delegate and go.  On the other hand, there are times when you want more threads and your own thread pool.  I may need 1 thread per client connection for example upto some max and what to leave the TP for io tasks.  In this case, we could use a custom Dispatcher (i.e. tp) using our own TP logic. The CCR has this option, I have not added that yet.&lt;br /&gt; &lt;br /&gt;&amp;quot;For example, it makes no sense to distribute work across 50 threads if you have two cores and each of those threads is going to utilize the core 100%. However, the thread is waiting for completion of other events (perhaps I/O, etc), then it does make sense.&amp;quot;&lt;br /&gt; &lt;br /&gt;Exactly. Good point. The thread pool is designed for exactly that.  If you have say max 4 threads in the thread pool and 2 cores, the thread pool will start 2 threads.  If one of those threads blocks on IO (which mostly happens eventually), another thread is released upto max threads. This now means 3 threads will be running when t2 unblocks. It is not ideal as now 2 threads will be competing for cpu time, but it works pretty well in general. There is some studder because of built in lag times so not to start and stop thread in a spastic way which would void most benefit from TP.&lt;br /&gt; &lt;br /&gt;&amp;quot;What sort of plans do you have for addressing these issues? Is there (and can there be) a clean separation of concerns between the work list and the assignment of a work item to a thread? If that were possible, then different engines for assigning the work item could be explored without affecting the core concepts of mailboxes/ports and pattern/selectors.&amp;quot;&lt;br /&gt; &lt;br /&gt;Plan is to at least as a custom Dispatcher that does its own TP. So there is a pretty clean separation of work list and worker today because we can swap Dispatchers with no change to other code and the selectors don't care what dispatcher is used - all they know is they run.  If you mean other, please explain. It is an interesting topic.&lt;br /&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Fri, 16 Mar 2007 16:29:38 GMT</pubDate><guid isPermaLink="false">NEW POST: How many threads, and how distributed? 20070316042938P</guid></item><item><title>NEW POST: Erlang Programming Language</title><link>http://www.codeplex.com/PCR/Thread/View.aspx?ThreadId=7542</link><description>&lt;div class="wikidoc"&gt;
That is interesting. I know nothing of Erlang, but that seems similar idea.  Your thoughts on Linq are right on. In many ways this is Linq like. I will explore linq integration how that may fit. If you have ideas, please let me know.&lt;br /&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Fri, 16 Mar 2007 16:07:23 GMT</pubDate><guid isPermaLink="false">NEW POST: Erlang Programming Language 20070316040723P</guid></item><item><title>How many threads, and how distributed?: </title><link>http://www.codeplex.com/PCR/Thread/View.aspx?ThreadId=7543</link><description>&lt;div class="wikidoc"&gt;
The major issue that I keep coming up against is how the work is assigned to a thread.  The .NET thread pool doesn't strike me as the right approach because worker threads are intended to get in and get out quickly.  So, a different threading model is required.  But it also begs the question, what kind of infrastructure would be needed to deal with issues such as thread creation and processor utilization?  &lt;br /&gt; &lt;br /&gt;For example, it makes no sense to distribute work across 50 threads if you have two cores and each of those threads is going to utilize the core 100%.  However, the thread is waiting for completion of other events (perhaps I/O, etc), then it does make sense.&lt;br /&gt; &lt;br /&gt;What sort of plans do you have for addressing these issues?  Is there (and can there be) a clean separation of concerns between the work list and the assignment of a work item to a thread?  If that were possible, then different engines for assigning the work item could be explored without affecting the core concepts of mailboxes/ports and pattern/selectors.&lt;br /&gt; &lt;br /&gt;Marc&lt;br /&gt;
&lt;/div&gt;</description><author>cliftonm</author><pubDate>Fri, 23 Feb 2007 15:59:35 GMT</pubDate><guid isPermaLink="false">How many threads, and how distributed?:  20070223035935P</guid></item><item><title>Erlang Programming Language: </title><link>http://www.codeplex.com/PCR/Thread/View.aspx?ThreadId=7542</link><description>&lt;div class="wikidoc"&gt;
This reminds me of the Erlang Programming Language, and its description of how concurrency is handled:&lt;br /&gt; &lt;br /&gt;&amp;quot;The processes communicate via a share-nothing asynchronous message-passing system: every process has a &amp;quot;mailbox&amp;quot;, a queue of messages sent by other processes, that are not yet consumed. Threads then use the receive primitive to retrieve messages that match desired patterns. A message-handling routine tests messages in turn against each pattern, until one of them matches. When the message is consumed (removed from the mailbox), the thread resumes execution.&amp;quot;&lt;br /&gt; &lt;br /&gt;So, for example, their &amp;quot;mailbox&amp;quot; is your &amp;quot;port&amp;quot;, their &amp;quot;pattern&amp;quot; is your &amp;quot;selector&amp;quot;.&lt;br /&gt; &lt;br /&gt;Is there any consideration to using Linq for building expressions that determine selector?  It seems like you're mostly there already with the delegate method.&lt;br /&gt;
&lt;/div&gt;</description><author>cliftonm</author><pubDate>Fri, 23 Feb 2007 15:51:19 GMT</pubDate><guid isPermaLink="false">Erlang Programming Language:  20070223035119P</guid></item><item><title>Source code checked in</title><link>http://www.codeplex.com/PCR/SourceControl/ListDownloadableCommits.aspx</link><description></description><author>staceyw</author><pubDate>Wed, 31 Jan 2007 22:57:36 GMT</pubDate><guid isPermaLink="false">Source code checked in 20070131105736P</guid></item><item><title>UPDATED WIKI: Cool comments from devs</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=Cool comments from devs&amp;version=1</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;Karloff wrote  Mon at 5:33 PM  delete this comment&lt;/b&gt;&lt;br /&gt;&lt;i&gt;Excellent work and a much needed alternative to CCR for the community who may not be able to utilize commercial licensing of the MS Robotics Runtime components. I look forward to giving the PCR a run. Keep up the fantastic job and thanks!&lt;/i&gt;&lt;br /&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Tue, 30 Jan 2007 16:51:49 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Cool comments from devs 20070130045149P</guid></item><item><title>UPDATED WIKI: FAQ</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=FAQ&amp;version=19</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
PCR FAQ
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Why%20PCR%3f"&gt;Why PCR?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=When%20did%20the%20PCR%20become%20self%20aware%3f"&gt;When did the PCR become self aware?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Port%3f"&gt;What is a Port?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Can%20I%20update%20UI%20with%20PCR%3f"&gt;Can I update UI with PCR?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Is%20there%20a%20Mono%20port%3f"&gt;Is there a Mono port?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20is%20this%20similar%20to%20events%3f"&gt;How is this similar to events?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Selector%3f"&gt;What is a Selector?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=The%20Source%20Readme%3f"&gt;The Source Readme?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20does%20locking%20work%3f"&gt;How does locking work?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20closure%3f"&gt;What is a closure?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Coroutine%3f"&gt;What is a Coroutine?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=When%20is%20port%20processed%20FIFO%20or%20not%3f"&gt;When is port processed FIFO or not?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20to%20create%20a%20task%20scheduler%3f"&gt;How to create a task scheduler?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Can%20I%20do%20recursion%3f"&gt;Can I do recursion?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Cool%20comments%20from%20devs"&gt;Cool comments from devs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Tue, 30 Jan 2007 16:50:54 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: FAQ 20070130045054P</guid></item><item><title>UPDATED WIKI: What is a Port?</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=What is a Port?&amp;version=1</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;What is a Port?&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;A port is a container for objects of a type. A port also contains a collection of handlers that will be evaluated in-order when a new item is added to the port. So a port contains both items and selectors(1) as seperate lists. After adding an item, if a selector is satisfied, the matching item(s) are removed from the port and the selector is invoked with the item(s).&lt;br /&gt; &lt;br /&gt;1) A Selector contains logic to pick one or more items from one or more ports.&lt;br /&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Tue, 30 Jan 2007 16:29:15 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: What is a Port? 20070130042915P</guid></item><item><title>UPDATED WIKI: FAQ</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=FAQ&amp;version=18</link><description>&lt;div class="wikidoc"&gt;
&lt;h2&gt;
PCR FAQ
&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Why%20PCR%3f"&gt;Why PCR?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=When%20did%20the%20PCR%20become%20self%20aware%3f"&gt;When did the PCR become self aware?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Port%3f"&gt;What is a Port?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Can%20I%20update%20UI%20with%20PCR%3f"&gt;Can I update UI with PCR?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Is%20there%20a%20Mono%20port%3f"&gt;Is there a Mono port?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20is%20this%20similar%20to%20events%3f"&gt;How is this similar to events?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Selector%3f"&gt;What is a Selector?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=The%20Source%20Readme%3f"&gt;The Source Readme?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20does%20locking%20work%3f"&gt;How does locking work?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20closure%3f"&gt;What is a closure?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=What%20is%20a%20Coroutine%3f"&gt;What is a Coroutine?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=When%20is%20port%20processed%20FIFO%20or%20not%3f"&gt;When is port processed FIFO or not?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=How%20to%20create%20a%20task%20scheduler%3f"&gt;How to create a task scheduler?&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=Can%20I%20do%20recursion%3f"&gt;Can I do recursion?&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Tue, 30 Jan 2007 16:21:05 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: FAQ 20070130042105P</guid></item><item><title>UPDATED WIKI: Home</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=Home&amp;version=33</link><description>&lt;div class="wikidoc"&gt;
&lt;h4&gt;
What is PCR?
&lt;/h4&gt;Port Concurrency Runtime (PCR) is a Port-Based asyncronous message passing library.&lt;br /&gt; &lt;br /&gt;Simply put, you push messages to ports and the messages are processed (i.e popped) asyncronously using handlers which we call Selectors. All messages (i.e. objects) are sent and received via a &lt;i&gt;Port&lt;/i&gt;.  &lt;i&gt;Selectors&lt;/i&gt; are user defined message handlers that can atomically process a single message or multiple messages from one or more ports based on rules defined by the Selector.  The library includes common selectors that should satisfy the most common patterns such as  &lt;i&gt;SelectOne&lt;/i&gt;, &lt;i&gt;SelectMany&lt;/i&gt;, &lt;i&gt;Choice&lt;/i&gt;, &lt;i&gt;Interleave&lt;/i&gt;, and &lt;i&gt;Join&lt;/i&gt;.&lt;br /&gt; &lt;br /&gt;&lt;pre&gt;
        /// &amp;lt;summary&amp;gt;
        /// Test single item selector. SelectOne &amp;quot;can&amp;quot; have a FIFO gaureentee (depending on other factors defined by usage). In this case, only one
        /// selector will be scheduled at a time, but can also be set to run concurrent. The selector will run again when a message is pushed on port.
        /// &amp;lt;/summary&amp;gt;
        static void SelectOneTest()
        {
            // Create a port and add some items.
            Port&amp;lt;string&amp;gt; p = new Port&amp;lt;string&amp;gt;();
            for (int i = 0; i &amp;lt; 20; i++)
                p.Push(i.ToString(&amp;quot;00&amp;quot;));
            int activeCount = 0;
 
            // Create and activate the selector.
            Selector.SelectOne&amp;lt;string&amp;gt;(true, p,
                delegate(string s)
                {
                    if ( Interlocked.Increment(ref activeCount) &amp;gt; 1 )
                        Console.WriteLine(&amp;quot;Error: active count should never go above 1.&amp;quot;);
                    Console.WriteLine(&amp;quot;SelectOneTest: {0} ThreadID:{1:00} Active:{2}&amp;quot;, s, Thread.CurrentThread.ManagedThreadId, activeCount);
                    Thread.Sleep(10);
                    Interlocked.Decrement(ref activeCount);
                }).Add(); 
        }
&lt;/pre&gt; &lt;br /&gt;The above code shows the general pattern that will be used by all selectors.  A port is created, messages are added, and we register a selector query to process messages when they arrive on the port. The PCR runtime handles invoking the selector(s) registered with the port based on the selector rules and message availability. So a selector could run right away or not at all. More complex patterns such as selecting from many ports (i.e. a Join) or selecting many messages from a single port follow the same pattern.  Things like &lt;i&gt;Where&lt;/i&gt; filters are as simple as supplying a predicate delegate to a selector.&lt;br /&gt; &lt;br /&gt;&lt;h5&gt;
Helpful Links
&lt;/h5&gt;&lt;ul&gt;
&lt;li&gt;&lt;b&gt;&lt;a href="http://www.codeplex.com/PCR/Wiki/View.aspx?title=FAQ"&gt;PCR FAQ&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://channel9.msdn.com/wiki/default.aspx/Channel9.ConcurrencyRuntime" class="externalLink"&gt;Microsoft CCR&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="http://www.codeplex.com/CodePlex/Wiki/View.aspx?title=CodePlex%20Wiki%20Markup%20Guide" class="externalLink"&gt;CodePlex Wiki help&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;--&lt;br /&gt;William Stacey [C# MVP]&lt;br /&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Tue, 30 Jan 2007 16:20:24 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: Home 20070130042024P</guid></item><item><title>UPDATED WIKI: When is port processed FIFO or not?</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=When is port processed FIFO or not?&amp;version=9</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;When are Port items processed in FIFO order?&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;By itself, a Port has &lt;i&gt;FIFO&lt;/i&gt; queue symantics. Items are added at the end of the port and retrieved from the start of the port. However, &lt;i&gt;Selectors&lt;/i&gt; can change this.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
A Port is FIFO when:
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;A Selector's &lt;i&gt;concurrent&lt;/i&gt; flag set to &lt;i&gt;false&lt;/i&gt;. Another handler will not be scheduled until the current handler completes.&lt;/li&gt;&lt;li&gt;No other selectors are attached to the port. Another selector may also grab items from the port. Therefore, in the context of each selector, items could seem to be missing.&lt;/li&gt;&lt;li&gt;No filter (i.e. a Where predicate) is used. A filter &lt;i&gt;explicitly&lt;/i&gt; nullifies the FIFO contract because it can grab items out of order.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;&lt;h3&gt;
A Port is &lt;b&gt;not&lt;/b&gt; FIFO when:
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;A Selector's &lt;i&gt;concurrent&lt;/i&gt; flag set to &lt;i&gt;true&lt;/i&gt;. This would allow multiple items to be scheduled concurrently. The order of execution is not defined by the OS scheduler.&lt;/li&gt;&lt;li&gt;Multiple selectors are attached to the same port. Selectors would compete for items and the order of execution would be undefined.&lt;/li&gt;&lt;li&gt;A filter is used. A Selector filter, by design, allows for out-of-order processing of items.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Tue, 30 Jan 2007 08:46:05 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: When is port processed FIFO or not? 20070130084605A</guid></item><item><title>UPDATED WIKI: When is port processed FIFO or not?</title><link>http://www.codeplex.com/PCR/Wiki/View.aspx?title=When is port processed FIFO or not?&amp;version=8</link><description>&lt;div class="wikidoc"&gt;
&lt;b&gt;When are Port items processed in FIFO order?&lt;/b&gt;&lt;br /&gt; &lt;br /&gt;By itself, a Port has &lt;i&gt;FIFO&lt;/i&gt; queue symantics. Items are added at the end of the port and retrieved from the start of the port. However, &lt;i&gt;Selectors&lt;/i&gt; can change this.&lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
A Port is FIFO when:
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;A Selector's &lt;i&gt;concurrent&lt;/i&gt; flag set to &lt;i&gt;false&lt;/i&gt;. Another handler will not be scheduled until the current handler completes.&lt;/li&gt;&lt;li&gt;No other selectors are attached to the port. Another selector may also grab items from the port. Therefore, in the context of each selector, items could seem to be missing.&lt;/li&gt;&lt;li&gt;No filter (i.e. a Where predicate) is used. A filter &lt;i&gt;explicitly&lt;/i&gt; nullifies the FIFO contract because it can grab items out of order.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt; &lt;br /&gt;&lt;h3&gt;
A Port is &lt;b&gt;not&lt;/b&gt; FIFO when:
&lt;/h3&gt;&lt;ul&gt;
&lt;li&gt;A Selector's &lt;i&gt;concurrent&lt;/i&gt; flag set to &lt;i&gt;true&lt;/i&gt;. This would allow multiple items to be scheduled concurrently. The order of execution is not defined by the OS scheduler.&lt;/li&gt;&lt;li&gt;Multiple selectors are attached to the same port. Selectors would compete for items and the order of execution would be undefined.&lt;/li&gt;&lt;li&gt;A filter is used. A Selector filter, by design, allows for out-of-order processing of items.&lt;/li&gt;
&lt;/ul&gt; &lt;br /&gt;
&lt;/div&gt;</description><author>staceyw</author><pubDate>Tue, 30 Jan 2007 08:45:40 GMT</pubDate><guid isPermaLink="false">UPDATED WIKI: When is port processed FIFO or not? 20070130084540A</guid></item></channel></rss>