O'Reilly logo

C# Multithreaded and Parallel Programming by Rodney Ringler

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Task schedulers

One of the main benefits of the Task Parallel Library versus developing using the Thread class is the TaskScheduler. This class does a lot of the logic that you had to program into your multithreaded code to achieve maximum performance and efficiency. This is what truly makes using TPL "lightweight" concurrency programming. The main job of the TaskScheduler class is to handle the work of queuing tasks to threads, or more specifically, the ThreadPool, and managing the ThreadPool to best utilize the number of processing cores on the machine it is being executed on.

One of the best features of the TaskScheduler is that it is an abstract class that you can derive your own classes from. The TaskScheduler allows you to schedule tasks ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required