Search code examples
operating-systemcritical-section

In the Critical Section Issue ,should processes in exit section influence the decision that which process will execute its critical section next?


enter image description here

The book is Operating System Concepts by Avi Silberschatz . Since processes in exit section have already executed their critical section , should they be allowed to influence the decision ?


Solution

  • I think that the intent is to say only processes which are competing to get to execute their critical section are allowed to be involved in deciding which one of them actually gets this permission.

    My reading of this is that the code is partitioned into four non-overlapping categories; the three sections entry, critical, and exit together relate to the critical-section problem, and the entirety of the rest of the program is the remainder. The text specifically says that code in the remainder section cannot participate in deciding which process is granted exclusive access to the critical region.

    I suppose the author doesn't want to rule out the possibility that a process in the exit section could get to decide "process Y, you go next" though the usual solution is different (Dijkstra's semaphore algorithm).