<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx</link><description>The June 2008 CTP of Parallel Extensions provides the first look at its 3 rd major piece, a set of coordination data structures we lovably refer to as CDS. It contains lightweight and scalable thread-safe data structures and synchronization primitives.</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8624953</link><pubDate>Fri, 20 Jun 2008 10:29:56 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8624953</guid><dc:creator>Steffen Zeidler</dc:creator><description>&lt;p&gt;The call CountdownEvent.Wait() can block the scheduler, is this correct?&lt;/p&gt;
&lt;p&gt;For example on a task manager with 2 processors and 2 threads per processor if there are 4 CountdownEvent waiting and then no more tasks can start.&lt;/p&gt;
&lt;p&gt;var event1 = new CountdownEvent(1);&lt;/p&gt;
&lt;p&gt;Parallel.For(0, 8, i =&amp;gt; { Debug.WriteLine(i); event1.Wait(); });&lt;/p&gt;
&lt;p&gt;//2 3 0 1&lt;/p&gt;
&lt;p&gt;The behaviour is the same using BlockingCollection.Remove().&lt;/p&gt;
&lt;p&gt;There is no such behaviour using Future.Wait().&lt;/p&gt;
&lt;p&gt;var event1 = Future&amp;lt;bool&amp;gt;.Create();&lt;/p&gt;
&lt;p&gt;Parallel.For(0, 8, i =&amp;gt; { Debug.WriteLine(i); event1.Wait(); });&lt;/p&gt;
&lt;p&gt;//1 0 3 2 4 5 7 6&lt;/p&gt;
</description></item><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8627236</link><pubDate>Sat, 21 Jun 2008 00:09:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8627236</guid><dc:creator>Alexandre</dc:creator><description>&lt;p&gt;This looks more and more interesting.&lt;/p&gt;
&lt;p&gt;I have been following this blog for a little while, and I have had a question in mind since then, which I have not seen addressed, and which I do not really know where to post:&lt;/p&gt;
&lt;p&gt;Is there any plan for PFX to use the GPU (graphics processor) incredible parallel processing abilities to accelerate Parallel.NET routines?&lt;/p&gt;
</description></item><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8642416</link><pubDate>Mon, 23 Jun 2008 18:09:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8642416</guid><dc:creator>toub</dc:creator><description>&lt;p&gt;Steffen, with the current CTP, yes, you can end up blocking all of the scheduler's threads, but the situation will improve with future releases; the current implementation is missing some features that causes the behavior you're seeing.&lt;/p&gt;
</description></item><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8642454</link><pubDate>Mon, 23 Jun 2008 18:18:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8642454</guid><dc:creator>toub</dc:creator><description>&lt;p&gt;Alexandre, we're certainly investigating general purpose GPU support, but we don't have anything to discuss regarding it at this time.&lt;/p&gt;
</description></item><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8686234</link><pubDate>Fri, 04 Jul 2008 03:39:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8686234</guid><dc:creator>Art Scott</dc:creator><description>&lt;p&gt;Hi Stephen. Thanks for the blog.&lt;/p&gt;
&lt;p&gt;I like Edward Lee's paper, is that MS's direction?&lt;/p&gt;
&lt;p&gt;The Problem with Threads, by Edward A. Lee&lt;/p&gt;
&lt;p&gt;EECS Department, University of California, Berkeley&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdf"&gt;http://www.eecs.berkeley.edu/Pubs/TechRpts/2006/EECS-2006-1.pdf&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Threads are a seemingly straightforward adaptation of the dominant sequential model of computation to concurrent systems... in software in order to take advantage of the predicted increases in parallelism ... I argue that this is not a good idea. They discard the most essential and appealing properties of sequential computation: understandability, predictability, and determinism. Threads, as a model of computation, are wildly nondeterministic, and the job of the programmer becomes one of pruning that nondeterminism. Rather than pruning nondeterminism, we should build from essentially deterministic, composable components. The consequences of this principle are profound. I argue for the development of concurrent coordination languages based on sound, composable formalisms.&lt;/p&gt;
</description></item><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8686363</link><pubDate>Fri, 04 Jul 2008 04:32:18 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8686363</guid><dc:creator>Art Scott</dc:creator><description>&lt;p&gt;I concur with the concerns expressed about graphics concurrent parallel performance benefiting from multi-core-CPU-GPGPU HW systems improvements.&lt;/p&gt;
&lt;p&gt;I'd like to know more about the uniqueness, specialness of the UI thread in a multi-core world.&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;
</description></item><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8769610</link><pubDate>Thu, 24 Jul 2008 20:04:10 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8769610</guid><dc:creator>Chernichkin Stanislav</dc:creator><description>&lt;p&gt;It would be nice if heap-based collection or any other type of priority-queue will be introduced in standard library.&lt;/p&gt;
</description></item><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8772312</link><pubDate>Fri, 25 Jul 2008 17:59:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8772312</guid><dc:creator>Rick Hudson</dc:creator><description>&lt;p&gt;&amp;quot;They impalement IConcurrentCollection&amp;lt;T&amp;gt;, a new interface providing thread-safe Add and Remove ...&amp;quot;&lt;/p&gt;
&lt;p&gt;Impalement seems a bit strong for such a useful interface.&lt;/p&gt;
&lt;p&gt;- Rick&lt;/p&gt;
</description></item><item><title>Netmedia  &amp;raquo; Blog Archive   &amp;raquo; C# 3.0 and Parallel FX/LINQ in Mono</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8788754</link><pubDate>Tue, 29 Jul 2008 16:40:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8788754</guid><dc:creator>Netmedia  &amp;raquo; Blog Archive   &amp;raquo; C# 3.0 and Parallel FX/LINQ in Mono</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://blog.netmedia.info/index.php/2008/07/29/c-30-and-parallel-fxlinq-in-mono/"&gt;http://blog.netmedia.info/index.php/2008/07/29/c-30-and-parallel-fxlinq-in-mono/&lt;/a&gt;&lt;/p&gt;
</description></item><item><title>re: Coordination Data Structures Overview</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#8934469</link><pubDate>Mon, 08 Sep 2008 22:07:53 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8934469</guid><dc:creator>Frank Bakker</dc:creator><description>&lt;p&gt;I really like the idea behind the LazyInit&amp;lt;T&amp;gt; class you added to the June CTP. I would like to give my feedback on the scenario's where I would like to use it that I think are not fully supported&lt;/p&gt;
&lt;p&gt;T is not allowed to be a value type, this prevents me from using it for calculations returning integers or decimals that are quite common in financial scenario's. &lt;/p&gt;
&lt;p&gt;Moreover the ValueSelector is not allowed to return null. In some of cases however null can be a valid value for a field an doesn't have to mean 'has not been initialized yet.&lt;/p&gt;
&lt;p&gt;I would opt to throw in the extra _isInitialized boolean to allow for both value types and refrence types that may be null, that would make this a real usefull feature..&lt;/p&gt;
&lt;p&gt;Besides that I was thinking about the way I would use this LazyInit object in a class like the following:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;class person&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string FirstName { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string LastName { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string WholeName { get { return FirstName + LastName);} }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;I would like to cache the value of WholeName (being an expensive calculation), and do something like:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;class person&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string FirstName { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string LastName { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LazyInit&amp;lt;string&amp;gt; _wholeName = new LazyInit&amp;lt;string&amp;gt;(() =&amp;gt; FirstName + LastName);&lt;/p&gt;
&lt;p&gt;	string Wholename { get { return _wholeName.Value; } }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;Unfortunately it is not allowed by the compiler to reference other fields inside the lambda that is used in de field initializer and I would have to create the LazyInit object in the constructor (introducing more code). An alternative approach could be:&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;class person&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string FirstName { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string LastName { get; set; }&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;LazyInit&amp;lt;string&amp;gt; _wholeName = new LazyInit&amp;lt;string&amp;gt;();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;string Wholename { get { return _wholeName.Retreive(() =&amp;gt; FirstName + LastName);}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;The retrieve would look something like&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;T Retrieve(Func&amp;lt;T&amp;gt; valueSelector)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt;	// add some smart double checking and locking here&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if (!_initialized)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_value = valueSelector();&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;return _value;&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;}&lt;/p&gt;
&lt;p&gt;The retrieve retrieves the initialized value if present, or create it if not. This allows me to write the delegate in the same context as where I want to use the result, which is generally where I want it.&lt;/p&gt;
&lt;p&gt;Maybe I'm stretching the intended semantics for LazyInit and maybe these models should be implemented in separate types instead of mixed, but this model it would reduce the amount of code in a lot of common situations.&lt;/p&gt;
</description></item><item><title> Parallel Programming with NET Coordination Data Structures Overview | Green Tea Fat Burner</title><link>http://blogs.msdn.com/pfxteam/archive/2008/06/18/8620615.aspx#9706351</link><pubDate>Mon, 08 Jun 2009 05:09:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9706351</guid><dc:creator> Parallel Programming with NET Coordination Data Structures Overview | Green Tea Fat Burner</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://greenteafatburner.info/story.php?id=4662"&gt;http://greenteafatburner.info/story.php?id=4662&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>