Coupon Accepted Successfully!


Critical Section

A critical section is a piece of code that accesses a shared resource (data structure or device), writing a file or updating a table that must not be concurrently accessed by more than one thread of execution. Thus, execution of critical sections by the processes is mutually exclusive in time.
General structure of a process is:



Entry section
Critical section
Exit section
Remainder section


Each process must request permission to enter its critical section, which is done in entry section. The critical section problem is to design a protocol that the processes can use to co-operate. A solution to the critical section problem must satisfy the three requirements:
1) Mutual Exclusion: If a process Pi is executing in its critical section, then no other process can enter it.
2) Progress: If no process is executing in its critical section and some processes wish to enter, then only those process which are not in remainder section can enter and the selection cannot be postponed indefinitely.
3) Bounded Waiting: After a process makes a request to enter critical section, then there is a bound on the number of times other processes are allowed to enter critical section before this process.

Test Your Skills Now!
Take a Quiz now
Reviewer Name