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

Working with thread locking and synchronization

Locking is an essential part of a multi-threaded application. Synchronization on the other hand is another important factor of a program that ensures the smooth running of the program in a managed environment. In this recipe, we are going to cover how to use thread locking and synchronization feature of .NET to avail the smooth running of the program logic.

While running a multi-threaded application which sometimes involves multi-core systems, resource sharing is one of the important concerns for developers. While being in concurrent access, mutual exclusion exists with the use of lock block of C#. In this recipe, we are going to cover how to employ locking on a portion of code that requests mutual ...

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