<?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>Mechanisms for Creating Tasks</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx</link><description>The core entity in the Task Parallel Library around which everything else revolves is System.Threading.Tasks.Task. The most common way of creating a Task will be through the StartNew method on the TaskFactory class, a default instance of which is exposed</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Mechanisms for Creating Tasks</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9810337</link><pubDate>Wed, 01 Jul 2009 07:24:29 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9810337</guid><dc:creator>Abhijeet Patel</dc:creator><description>&lt;p&gt;Hi Stephen:&lt;/p&gt;
&lt;p&gt;re:&amp;quot;_&amp;quot; is a valid identifier name.&lt;/p&gt;
&lt;p&gt;Right...I guess I'm just used to seeing alphabetic identifiers in general and hence the &amp;quot;_&amp;quot; threw me off,come to think of it &amp;quot;_xxx&amp;quot; is a common naming convention for private data members but I never realized(nor have ever used ) &amp;quot;_&amp;quot; by itself as an identifier.&lt;/p&gt;
&lt;p&gt;Thanks for the clarification.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9810337" width="1" height="1"&gt;</description></item><item><title>re: Mechanisms for Creating Tasks</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9809350</link><pubDate>Tue, 30 Jun 2009 10:10:48 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809350</guid><dc:creator>Stephen Toub - MSFT</dc:creator><description>&lt;p&gt;Hi Abhijeet-&lt;/p&gt;
&lt;p&gt;re: is this correct?&lt;/p&gt;
&lt;p&gt;Oops, no, it was a typo. &amp;nbsp;Should have been &amp;quot;t.ContinueWith&amp;quot; rather than &amp;quot;timer.ContinueWith&amp;quot;. &amp;nbsp;I fixed it in the post. Thanks.&lt;/p&gt;
&lt;p&gt;re: is this just pseudocode or valid C#&lt;/p&gt;
&lt;p&gt;In C#, &amp;quot;_&amp;quot; is a valid identifier name. &amp;nbsp;Since my delegate doesn't need the parameter that's passed in, I've used an &amp;quot;_&amp;quot; to signify that I don't care about it.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9809350" width="1" height="1"&gt;</description></item><item><title>re: Mechanisms for Creating Tasks</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9809335</link><pubDate>Tue, 30 Jun 2009 09:42:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9809335</guid><dc:creator>Abhijeet Patel</dc:creator><description>&lt;p&gt;In your first code sample, you have a ContinueWith on the Timer object, is this correct?&lt;/p&gt;
&lt;p&gt;Also, not sure what the underscore means, is this just pseudocode or valid c#?&lt;/p&gt;
&lt;p&gt;var timer = new Timer(&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;_ =&amp;gt; t.Start(), null, millisecondsDelay, Timeout.Infinite);&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;timer.ContinueWith(_ =&amp;gt; timer.Dispose());&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9809335" width="1" height="1"&gt;</description></item><item><title> Parallel Programming with NET Mechanisms for Creating Tasks | fire pit</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9780106</link><pubDate>Fri, 19 Jun 2009 09:05:17 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9780106</guid><dc:creator> Parallel Programming with NET Mechanisms for Creating Tasks | fire pit</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://firepitidea.info/story.php?id=576"&gt;http://firepitidea.info/story.php?id=576&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9780106" width="1" height="1"&gt;</description></item><item><title>re: Mechanisms for Creating Tasks</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9771043</link><pubDate>Thu, 18 Jun 2009 02:35:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9771043</guid><dc:creator>Stephen Toub - MSFT</dc:creator><description>&lt;p&gt;Hi James-&lt;/p&gt;
&lt;p&gt;The June 2008 CTP does have ContinueWith methods on Task, so you should be able to use them there.&lt;/p&gt;
&lt;p&gt;The bits have changed significantly since incorporation into .NET 4, so if you can install the .NET Framework 4 Beta, that'll be your best bet for playing with recent bits.&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx"&gt;http://msdn.microsoft.com/en-us/vstudio/dd582936.aspx&lt;/a&gt;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9771043" width="1" height="1"&gt;</description></item><item><title>re: Mechanisms for Creating Tasks</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9769919</link><pubDate>Wed, 17 Jun 2009 20:34:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9769919</guid><dc:creator>James B</dc:creator><description>&lt;p&gt;You mention &amp;quot;Task also exposes a ContinueWith mechanism that can be used to create a Task that will be scheduled when the antecedent task (the Task on which ContinueWith is being called) completes.&amp;quot;, which I see here:&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://msdn.microsoft.com/en-us/library/dd321262"&gt;http://msdn.microsoft.com/en-us/library/dd321262&lt;/a&gt;(VS.100).aspx&lt;/p&gt;
&lt;p&gt;However, I do not see anything like this in the June 2008 CTP. Am I correct in thinking it is missing? If so, is there anywhere I can get a more modern library, usable outside a VS2010 VM?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9769919" width="1" height="1"&gt;</description></item><item><title>Mechanisms for Creating Tasks | VishwaTech IT News</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9769232</link><pubDate>Wed, 17 Jun 2009 15:22:26 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9769232</guid><dc:creator>Mechanisms for Creating Tasks | VishwaTech IT News</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://www.vishwatech.com/globalnews/?p=1726"&gt;http://www.vishwatech.com/globalnews/?p=1726&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9769232" width="1" height="1"&gt;</description></item><item><title> Parallel Programming with NET Mechanisms for Creating Tasks | fix my credit</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9763779</link><pubDate>Wed, 17 Jun 2009 04:29:50 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9763779</guid><dc:creator> Parallel Programming with NET Mechanisms for Creating Tasks | fix my credit</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://fixmycrediteasily.info/story.php?id=4745"&gt;http://fixmycrediteasily.info/story.php?id=4745&lt;/a&gt;&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9763779" width="1" height="1"&gt;</description></item><item><title>re: Mechanisms for Creating Tasks</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9702851</link><pubDate>Sat, 06 Jun 2009 17:57:44 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9702851</guid><dc:creator>Eric Eilebrecht - MSFT</dc:creator><description>&lt;p&gt;Timer works by registering itself with the ThreadPool, which inserts the timer in a list of active timers. &amp;nbsp;The ThreadPool maintains a separate &amp;quot;timer thread&amp;quot; which calls Sleep() with the duration of the timer that will fire next. &amp;nbsp;Offloading the Sleep to this special thread has two benefits: &amp;nbsp;first, it frees the worker thread to execute other tasks, and second it allows multiple timers to be processed by a single thread. &amp;nbsp;So instead of tying up 10 threads with 10 calls to Thread.Sleep, you have a single thread handling all 10 timers. &amp;nbsp;As each timer fires, the callback is queued back to the worker pool, freeing up the timer thread to process the rest of the timers.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9702851" width="1" height="1"&gt;</description></item><item><title>re: Mechanisms for Creating Tasks</title><link>http://blogs.msdn.com/b/pfxteam/archive/2009/06/03/9691796.aspx#9702732</link><pubDate>Sat, 06 Jun 2009 14:44:34 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9702732</guid><dc:creator>aL</dc:creator><description>&lt;p&gt;ah i see.. so it does sort of what Timer does but on the OS thread level instead of the Task level? it'd be interesting to hear more about how Timer does its thing :) does it talk to the threadpool directly and asks not to be scheduled until the time has passed? how does it do that? with an internal api?&lt;/p&gt;
&lt;p&gt;sorry, lots of questions.. but the tpl is very interesting stuff :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9702732" width="1" height="1"&gt;</description></item></channel></rss>