O'Reilly logo

Hands-On Design Patterns with C# and .NET Core by Jeffrey Chilberto, Gaurav Aroraa

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

Multithreading and asynchronous programming

To put it simply, we can say that multithreading means that a program is running parallel on multiple threads. In asynchronous programming, a unit of work runs separately from the main application thread, and it tells the calling thread that the task has completed, failed, or is in progress. The interesting issues to consider around asynchronous programming are when we should use it and what its benefits are.

The potential for more than one thread to access the same shared data and update it with unpredictable results can be referred to as a race condition. We have already discussed race condition in Chapter 4, Implementing Design Patterns - Basics Part 2.

Consider the scenario we discussed in the ...

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