﻿<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel><title>Ayende @ Rahien</title><link>http://ayende.com</link><description>Ayende @ Rahien</description><copyright>Copyright (C) Ayende Rahien  2004 - 2021 (c) 2026</copyright><ttl>60</ttl><item><title>James Manning commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>In case anyone runs across this post and doesn't already know about it, you can use the Async Targeting Pack to build .NET 4 / SL5 apps and use async/await.

http://blogs.msdn.com/b/pfxteam/archive/2012/04/26/10297848.aspx
</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment11</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment11</guid><pubDate>Thu, 17 May 2012 22:28:37 GMT</pubDate></item><item><title>configurator commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>@Matt: Using the TPL doesn't necessarily mean using different threads, you know.

@Matt the second: In the first example, you're actually running the code synchronously on a different thread instead of using the TPL's ContinueWith. ContinueWith will continue after the first task is finished, without having a thread whose sole purpose is to Wait() on another task.

@Ayende: At least this example was simple enough that you didn't need gotos...</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment10</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment10</guid><pubDate>Thu, 17 May 2012 21:04:11 GMT</pubDate></item><item><title>Janus007 commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>@Matt, rumors say that you can't use log4net for TPL, log4net is old deprecated and stopped at C# 2.0. Something in the way TPL handles the threads influence the way log4net works. 

But I know that NLog is perfect for the job :)
</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment9</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment9</guid><pubDate>Thu, 17 May 2012 20:17:01 GMT</pubDate></item><item><title>Matt commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>I'm not that familiar with TPL, what's wrong with the firt example that requires the verbosity/complexity of the second?</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment8</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment8</guid><pubDate>Thu, 17 May 2012 15:35:09 GMT</pubDate></item><item><title>Matt commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>@George  you can use a tool like log4net, if you set the pattern up correctly it will tell you the thread id in the log message - the defaults usually have this in.  It's generally a good idea to have some kind of logging in your production apps any way and log4net is pretty universal.  There's also classes in the System.Threading namespace that will give you information about the current thread.</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment7</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment7</guid><pubDate>Thu, 17 May 2012 15:16:59 GMT</pubDate></item><item><title>George B commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>How would one be able to test this code to insure that its all operating on a new thread and that it is indeed running fully asynch?  I've just started to dive into tasks and have no way of knowing if what I am doing is having an effect.  Is there something I can write out to the console?</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment6</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment6</guid><pubDate>Thu, 17 May 2012 13:40:28 GMT</pubDate></item><item><title>alex commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>I think this article describes  extension you need here.
http://blogs.msdn.com/b/pfxteam/archive/2010/11/21/10094564.aspx</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment5</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment5</guid><pubDate>Thu, 17 May 2012 11:12:12 GMT</pubDate></item><item><title>Simon Hughes commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>If the needList is large, you may blow your stack memory.
There must be a better way.</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment4</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment4</guid><pubDate>Thu, 17 May 2012 10:41:13 GMT</pubDate></item><item><title>Graeme Christie commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>Or just use an Enumerator to mimick co-routines ... that's about my favourite .NET hack, I'll almost be a bit sad when we have c#5 await and I won't need to use it anymore.


</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment3</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment3</guid><pubDate>Thu, 17 May 2012 10:18:40 GMT</pubDate></item><item><title>Graeme Christie commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>Or just use an Enumerator to mimick co-routines ... that's about my favourite .NET hack, I'll almost be a bit sad when we have c#5 await and I won't need to use it anymore.


</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment2</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment2</guid><pubDate>Thu, 17 May 2012 10:17:59 GMT</pubDate></item><item><title>tobi commented on When using the Task Parallel Library, Wait() is a BAD warning sign</title><description>Write yourself a ForeachAsync combinator for such things. It takes away all the recursive nastiness.</description><link>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment1</link><guid>http://ayende.com/155585/when-using-the-task-parallel-library-wait-is-a-bad-warning-sign#comment1</guid><pubDate>Thu, 17 May 2012 09:10:36 GMT</pubDate></item></channel></rss>