What is critical section problem? Why executive critical section must be exclusive? Explain.



Sometimes a process have to access shared memory or files, or doing other critical things that can lead to races. That part of the program where the shared memory is accessed is called the critical section or critical region. The critical-section problem is to design a protocol that the processes can cooperate. Each process must request permission to enter its critical section. The section of code implementing this request is called entry section. The critical section may be followed by a section of code known as exit section. The remaining code is known as remainder section.
In order to solve the critical section problem, executive critical section must be exclusive. That is, if a process P1 is executing in its critical section, then no other processes can be executing in their critical sections.

0 comments:

Feel free to contact the admin for any suggestions and help.