Synchronization
In the previous chapter, we went through the basic concepts and the widely used terminology of concurrency. In this chapter, we are going to focus on issues that might appear as a result of using concurrency in a program. Like the previous chapter, we won't deal with any C source code; instead, we'll place our focus solely on the concepts and the theoretical background around concurrency issues and resolving them.
As part of this chapter, we're going to learn about:
- Concurrency-related issues, namely, race conditions, and data races: We will discuss the effect of having a shared state among multiple tasks and how simultaneous access to the shared variable can lead to issues.
- Concurrency control techniques used to synchronize access to a shared state: We will be mainly talking about these techniques from a theoretical point of view, and we will be explaining the approaches we could take to overcome concurrency-related...