Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>It is decided by the <a href="http://msdn.microsoft.com/en-us/library/system.threading.tasks.paralleloptions.taskscheduler%28v=vs.110%29.aspx" rel="nofollow noreferrer">TaskScheduler set in the ParallelOptions</a> of the TPL methods. This lets you easily replace the TaskScheduler with <a href="http://blogs.msdn.com/b/pfxteam/archive/2010/04/09/9990424.aspx" rel="nofollow noreferrer">a custom one</a> that could do whatever plan for paralization you want.</p> <p>The default scheduler the TPL and PLINQ uses the is the <a href="http://msdn.microsoft.com/en-us/library/system.threading.threadpool.aspx" rel="nofollow noreferrer">ThreadPool</a>. It will start by using one thread then add more threads as its algorithm detects that more threads would be useful (however if your task is not CPU bound the algorithm can make some incorrect assumptions and <a href="https://stackoverflow.com/questions/6977218/parallel-foreach-can-cause-a-out-of-memory-exception-if-working-with-a-enumera">cause you problems</a>). </p> <p>I highly recommend you read the free book <a href="http://www.microsoft.com/en-us/download/details.aspx?id=19222" rel="nofollow noreferrer">Patterns for Parallel Programming</a>, it goes in to some detail about this. However the best book that I have read that goes in to a lot of detail about how the task scheduler works is <a href="http://rads.stackoverflow.com/amzn/click/0470495995" rel="nofollow noreferrer">Professional Parallel Programming with C#</a> (Chapter 8 is all about Thread Pools). </p> <p>I also recommend you download the package <a href="http://code.msdn.microsoft.com/Samples-for-Parallel-b4b76364" rel="nofollow noreferrer">Samples for Parallel Programing with the .NET framework</a>, it has a whole bunch of well commented projects inside it that helps explain a lot of concepts of parallel programming.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload