Shared Resources - Problems with Concurrency

What are the special programming problems in systems with interleaving or distributed concurrency? Firstly, whether we have an interleaved system, or a real distributed system, we have to protect Critical Regions of code. These are sections of code that may alter the value of Shared Variables. Because of concurrency, it is possible for incorrect values to arise, where the sequence of operations on these variables is not carefully controlled. This is discussed further in Chapter 3. Secondly, we have to control ownership of resources. A number of incorrect behaviors can result from incorrect sequences of resource allocation. These are: