.NET Framework 4 Parallel Extensions Also Have Powerful Extras

.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.

Parallel Extensions Extras is a complementary project that isn't part of the .NET 4 classes but it has been developed by Microsoft. As these extras include the source code, you can also tailor them for your specific needs. The extras are a bit hidden because they are included in one of the projects within the Parallel Extension Samples. The direct link to download its recently updated latest version is http://code.msdn.microsoft.com/ParExtSamples/Release/ProjectReleases.aspx?ReleaseId=4179 . So, if you download these samples for parallel programming with .NET 4, you can find and inspect the "ParallelExtensionExtras" project that contains all the extras organized in many folders, as in the next picture that displays the contents for this project in Visual Studio 2010 Solution Explorer.

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.

View Article



Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Live Event Date: October 29, 2014 @ 11:00 a.m. ET / 8:00 a.m. PT Are you interested in building a cognitive application using the power of IBM Watson? Need a platform that provides speed and ease for rapidly deploying this application? Join Chris Madison, Watson Solution Architect, as he walks through the process of building a Watson powered application on IBM Bluemix. Chris will talk about the new Watson Services just released on IBM bluemix, but more importantly he will do a step by step cognitive …

  • Live Event Date: October 29, 2014 @ 1:00 p.m. ET / 10:00 a.m. PT It's well understood how critical version control is for code. However, its importance to DevOps isn't always recognized. The 2014 DevOps Survey of Practice shows that one of the key predictors of DevOps success is putting all production environment artifacts into version control. In this eSeminar, Gene Kim will discuss these survey findings and will share woeful tales of artifact management gone wrong! Gene will also share examples of how …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds