Parallel Extensions
Template:Future software
Task Parallel Library (TPL, also referred to as Parallel FX Library) is a managed concurrency library being developed by a collaboration between Microsoft Research and the CLR team at Microsoft for inclusion with a future revision of the .NET Framework. It exposes parallel constructs like a parallel for
or while
loop, using regular method calls and delegates. As such, the constructs can be used from any language supporting the .NET Framework. The job of spawning and terminating threads, as well as scaling the number of threads according to the number of available processors is done by the library itself.
TPL also includes other constructs such as Task and Future. A Task is an action that can be executed independent of the rest of the program. In that sense, it is equivalent to a thread, except that the programmer is relieved of the job of synchronizing the execution of the thread. A Future is a specialized task that returns a result. The result is computed in a background thread encapsulated by the Future object, and the result is buffered till it is retrieved.
The library is slated to have a CTP release in Autumn 2007.