Mutual Exclusion
Mutual Exclusion is the required communication between two or more processes that are running in parallel and that need at the same time the use of a non-sharable resource. It consists in assigning the non-shareable resource to only one of the processes, while the others must remain waiting until the use of said resource is completed by the process to which it is assigned. When this process is finished, the resource will be assigned to one of the waiting processes. The correct use of the resource is ensured.
- Requirements for Mutual Exclusion
Non-shareable resources, whether peripheral, files, or data in memory, can be protected from simultaneous access by several processes, preventing them from running concurrently their code fragments through which they carry out this access. These pieces of code are called critical sections or regions, assimilating the concept of mutual exclusion in the use of these resources to the idea of mutual exclusion in the execution of the critical sections. Thus, for example, the mutual exclusion of several processes can be implemented in the access to a table of data by means of which all the routines that read or update the table are written as critical sections, so that only one of them can be executed both.
The selection of primitive operations to ensure mutual exclusion of critical sections is a major decision in the design of an operating system. At least, an appropriate solution should meet the following four conditions:
- That there are not at any time two processes within their respective critical sections.
- That they do not make assumptions a priori about the relative speeds of the processes or the number of available processors.
- That no process outside their critical section can block others.
- That no process has to wait an arbitrarily large time interval to enter its critical section.
Atomic Transactions
It is a method of high-level synchronization that does not occupy the programmer in the aspects of mutual exclusion, prevention of blockages and recovery from failures. On the contrary, this method directs the effort of the programmer to the real problems and essence of the synchronization of distributed systems.
The concept of atomic transactions consists in guaranteeing that all the processes that make up a transaction must be executed in a complete and satisfactory way. If it fails in any of the processes, the entire transaction fails, reversing it and proceeding to restart it.
PDF File:
Mutual Exclusion and Atomic Transactions - Vega, Ernesto