Critical - Section Problem :
Critical - Section Problem is an segment of a code in which a process may be
- changing common variables
- Upating a table or
- Writing a file.
General Structure of a typical process :
do {
entry section
critical section
exit section
remainder section
} while (true);
- Entry - Section : It requests permission to enter the critical -section.
- Critical - Section : Mutually exclusive in time which is having no other process can execute in its critical - Section.
- Exit - Section : It follows the critical - Section.
- Remainder - Section : It ensures the one process is executing in its critical - Section.
Solutions for the Critical - Section that it must satisfy the 3 requirements :
- Mutual Exclusion : This is only one process can be in its critical-section.
- Progress : The only processes that are not in their remainder-section can enter their critical-section.
- Bounded Waiting : There must be a bound on the nummber of times that other processes are allowed to enter their critical-section after the process has made a request to enter its critical-section and before the request is granted.