O'Reilly logo

Visual Studio 2012 and .NET 4.5 Expert Development Cookbook by Abhishek Sur

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

Lock statement using task-based parallelism in concurrent programming

Concurrent programming, as we have seen in common threading patterns, is being simplified day-by-day. In .NET 4.0 Microsoft introduced a new complex type Task that simplifies the asynchrony more than ever before. The concurrency has been separated with asynchrony and the task is named as something that is expected in future. Every asynchronous operation is specified with a task either by using CPU cycles, an input/output operation, a Network card, or even some other device. The tasks are identified by SynchronizationContext when the operation has finished its execution and gets you the result to the calling environment.

The Task Parallel Library (TPL) inherently uses ThreadPool ...

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