Synchronization Primitives

In daily life, there’s a lot of concurrency. Everyone is doing his or her own thing at a personal pace. Although this provides absolute freedom, sometimes different parties need to work together to accomplish something. To do so, rules must be established to prevent the participating individuals from stepping on each other’s toes.

Examples of this abound. Just think of traffic. Although lots of people can drive vehicles at the same time, traffic signs are put in place to prevent bad things (such as collisions) from happening. Therefore, the degree of concurrency of all the parties involved might have to be decreased. For example, a road intersection is a shared resource used for vehicles coming from different directions. ...

Get C# 5.0 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.