Conditions of competition
The conditions of competition correspond to the situations in which find several process trying to reach the same moment with the same shared resource (Fichier, Imprimante, etc…). The result of such situations depends on the way in which they are treated. Indeed, if there is not an ad hoc management of the problems raised by the conditions of competitions it can result from it from the unexplained situations (truncated Files, infinite waitings of i/o, etc…)
Conditions of competition
In a Multi-task context , several process is ammenés to reach the same resource. A traditional example is the access to a zone common memory between several Thread. These situations where several processes reach the same resource shared at the same time are named conditions of competition.
Example of access to a resource of impression
When a process wants to print a page, he writes an entry in a waiting list and increments a pointer which points towards the next free entry. What arrives if a first process between its entry and that the operating system decides to allocate the processor with a second process immediately afterwards? The second process, if he asks him also an impression, will write its entry in the same one as that of the first process since this one did not have time to increment the pointer. The page of the first process will thus not be printed.
The mutual Exclusion
Mutual exclusion is a method making it possible to avoid the conditions of competition and thus to make sure that when a process reaches a divided element, the other processes will be blocked on standby resource.If one prevents the processes from reaching at the same time the same resource shared i.e. to enter their Section criticizes at the same time, the conditions of competitions are avoided.
Various types of mutual exclusion exists:
-
the desactivation of the interruption S
- the monitors
- the bolts
- the semaphores
- the Mutex (Version simplified of the semaphores)
See too
| Random links: | Canadian company of endocrinology and metabolism | Ford (France) | Carl-Gustaf Rossby | Velia (Rome ancient) | Perrégaux | Tourisme_de_drogue |