- The simplest way to control access of resources is to schedule all critical sections on the processor non-preemptively.
- When a job holds any resources, it executes at priority higher than the priority of all This protocol is call non-preemptive critical section protocol (NPCS). Because no job is ever preempted when it holds any resource, deadlock can never occur.
- The most important advantages of NPCS protocol is its simplicity especially when the number of resource units are arbitrary.
- The protocol does not need any prior knowledge about resource requirement of jobs.
- It is simple to implement and can be used in both fixed priority and dynamic priority systems.
- It is clearly a good protocol when all the critical sections are short and when most of jobs conflict with each other.
- Short coming of this protocol is that every job can be blocked by every lower priority jobs with a critical section even if there is no resource and shows very poor performance.
For example:
Job |
ri |
ei |
Critical Section |
J1 |
6 |
5 |
R,2 |
J2 |
2 |
7 |
R,4 |
J3 |
0 |
6 |
R,4 |