.NET Framework 4 offers dozens of new classes, structures and enumerations to support many common parallelism scenarios. However, there are some additional scenarios not covered in the base classes that compose Parallel Extensions.
.NET Framework 4 includes the new Parallel Extensions. They offer the new task-based programming model, PLINQ (short for "Parallel Language Integrated Query") and many other features to tackle the multicore and manycore revolution. If you face one of these scenarios in which you have to make either simple or complex customizations to tailor the base classes to tackle certain specific requirements, be sure to check the scenarios covered by the new Parallel Extensions Extras.
A typical situation that usually needs a customized scheduler is when you want to use many tasks to run a pipeline. Each task represents a stage for the pipeline and you want to make sure that the task scheduler dedicates a thread to support the execution of each task. To do so, you can use the ThreadPerTaskScheduler class, included in the ParallelExtensionExtras project. This class is a subclass of System.Threading.Tasks.TaskScheduler and provides a task scheduler that dedicates a thread per task. It simply starts a new thread to process the provided task. Thus, you can create the tasks that will compose each stage of the pipeline with the necessary parameters to specify this customized scheduler. The ThreadPerTaskScheduler class is one of the nine customized task schedulers provided by Parallel Extensions Extras.
There are many other additional examples and these classes are worth a deeper analysis with complete examples of how to take advantage of them. In future posts, I'll explain samples that cover their usage. Parallel Extensions Extras groups the classes in the following categories:
- Coordination data structures in the "CoordinationDataStructures" folder.
- Drawing in the "Drawing" folder.
- Extensions in the "Extensions" folder.
- Parallel algorithms in the "ParallelAlgorithms" folder.
- Partitioners in the "Partitioners" folder.
- Task schedulers in the "TaskSchedulers" folder.
- Utils in the "Utils" folder.
.NET Framework 4 offers dozens of new classes, structures and enumerations to support many common parallelism scenarios.