<?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>Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx</link><description>Suppose a city has a whole bunch of bank branches, each of which has a whole bunch of tellers and one gofer. There are a whole bunch of customers in the city, each of whom wants to withdraw a whole bunch of money from the bank at some varying time throughout</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10093810</link><pubDate>Fri, 19 Nov 2010 14:20:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10093810</guid><dc:creator>MZ</dc:creator><description>&lt;p&gt;Yes it certainly does. Still CLR unlike JVM does evolve (example: con- and contra- variance in 4.0) so that shouldn&amp;#39;t be a blocker.&lt;/p&gt;
&lt;div class="yellowbox"&gt;
&lt;p&gt;Though your point is well-taken, I note that generic variance was added to the CLR in v2, not v4. No mainstream languages took advantage of that feature until C# 4.0 and VB 10, but it has been there since generics were implemented in the first place. - Eric&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10093810" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10088903</link><pubDate>Wed, 10 Nov 2010 15:47:36 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088903</guid><dc:creator>Gabe</dc:creator><description>&lt;p&gt;MZ: Doesn&amp;#39;t the use of tasklets require modifications to the CLR? Granted, I&amp;#39;m all for modifying the CLR to support that...&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088903" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10088703</link><pubDate>Wed, 10 Nov 2010 10:16:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088703</guid><dc:creator>MZ</dc:creator><description>&lt;p&gt;Followup: Coroutine implementation &lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="https://bugzillafiles.novell.org/attachment.cgi?id=359204"&gt;bugzillafiles.novell.org/attachment.cgi&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=10088703" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10088702</link><pubDate>Wed, 10 Nov 2010 10:13:11 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088702</guid><dc:creator>MZ</dc:creator><description>&lt;p&gt;Have you considered replicating Mono&amp;#39;s coroutine approach?&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.mono-project.com/Continuations"&gt;www.mono-project.com/Continuations&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Apart from still being buggy in Mono, this allows for easy suspension of function execution.&lt;/p&gt;
&lt;p&gt;No need to expand into a state machine.&lt;/p&gt;
&lt;p&gt;My sample implementation of coroutines usting tasklets (circa 50 lines of code):&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="https://bugzillafiles.novell.org/attachment.cgi?id=359205"&gt;bugzillafiles.novell.org/attachment.cgi&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;(did I mention, it&amp;#39;s still buggy? :P)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088702" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10088509</link><pubDate>Tue, 09 Nov 2010 22:49:25 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088509</guid><dc:creator>Stuart</dc:creator><description>&lt;p&gt;How about just bump people back to the front of the queue if the teller is unable to finish servicing their request due to lack of bills? Given that we&amp;#39;re using the W system (one shared queue) that should work fine as long as we have a way for the tellers to skip people that they know in advance they can&amp;#39;t service.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088509" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10088460</link><pubDate>Tue, 09 Nov 2010 21:29:05 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088460</guid><dc:creator>Aaron G</dc:creator><description>&lt;p&gt;You kind of left out the punchline - what&amp;#39;s the *correct* approach to this situation, in either the bank analogy or the world of asynchrony?&lt;/p&gt;
&lt;p&gt;My guess is that you would send each client into some sort of limited &amp;quot;wait pool&amp;quot; (waiting area?) every time they need to wait on I/O (or the gofer), and whenever the I/O thread (gofer) comes back, you make a note to check the pool after the current request is done and finish off whatever you can. &amp;nbsp;Presumably if the pool has a limited size then eventually the line will start to snake out the door again if you get too busy.&lt;/p&gt;
&lt;p&gt;But, maybe this is way too simplistic an approach, or too close in concept to the warehouse situation. &amp;nbsp;Is there a better way?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088460" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10088021</link><pubDate>Tue, 09 Nov 2010 08:00:07 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088021</guid><dc:creator>Rob Reckless</dc:creator><description>&lt;p&gt;AN excellent blog on Asynchrony!&lt;/p&gt;
&lt;p&gt;Rob Reckless - RecklessDevelopment&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://www.recklessdevelopment.com"&gt;www.recklessdevelopment.com&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=10088021" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10088003</link><pubDate>Tue, 09 Nov 2010 06:50:15 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10088003</guid><dc:creator>Gabe</dc:creator><description>&lt;p&gt;I think typing 100 wpm is nearly 10 keystrokes per second. It&amp;#39;s hard to imagine somebody typing that fast for long enough that a few garbage objects for every keystroke could cause enough memory pressure to make a noticeable performance difference. Clearly making a single timer that gets reset on each keystroke was the right decision, but it&amp;#39;s still hard to imagine that creating 10 timers per second for brief periods causes performance problems.&lt;/p&gt;
&lt;p&gt;BTW, using the W style of queueing is the right thing to do here because then the line doesn&amp;#39;t stall unless all the tellers are asleep waiting for the gofer. And if more tellers can open up their stations when too many other tellers are waiting for the gofer, the line will never stall until the bank runs out of teller stations.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10088003" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10087975</link><pubDate>Tue, 09 Nov 2010 04:42:04 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10087975</guid><dc:creator>Gaurav</dc:creator><description>&lt;p&gt;The more I learn about implementations of asynchrony the more I love it.&lt;/p&gt;
&lt;p&gt;&amp;quot;More thoughts on syntactic concerns&amp;quot; &amp;nbsp;desperately waiting :)&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10087975" width="1" height="1"&gt;</description></item><item><title>re: Asynchrony in C# 5 Part Five: Too many tasks</title><link>http://blogs.msdn.com/b/ericlippert/archive/2010/11/08/asynchrony-in-c-5-part-five-too-many-tasks.aspx#10087811</link><pubDate>Mon, 08 Nov 2010 20:44:55 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10087811</guid><dc:creator>Frank Quednau</dc:creator><description>&lt;p&gt;The Rx design guidelines show a similar situation of capturing keystrokes and kicking off a dictionary search. However, they use a Throttle which appears to be a more clever approach this time round :) &lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10087811" width="1" height="1"&gt;</description></item></channel></rss>