Critical Section Problem

In this topic, you will learn about, Critical Section Problem.

Critical Section Problem: Let us consider a system consisting of n processes (P0……. Pn-1). Each process has a segment of code, called a critical section, in which the process may be changing, common variables, updating of tables, writing a file, and so on.

The important feature of this system is that, when one process is executing in its critical section, no other process is to be allowed to execute in its critical section.

Thus, the execution of the critical section by the processes is mutually exclusive in time. The critical system problem is to design a protocol that the process can use to cooperate.

A solution to the critical selection problem must satisfy the following three requirements:

  1. Mutual exclusion: A process Pi is executing in its critical section then no other processes can be executing in their critical section.
  2. Progress: if no process is executing in its critical sections and they exist some processes that wish to enter in a critical section then only those processes that are not executing in their remainder section can participate.
  3. Bounded waiting: there exist a bound on the number of times that another process is allowed to enter their critical sections after a process has made a request to enter its critical section and before that request is granted.

Comment below if you have queries related to the above topic, Critical Section Problem.