מערכות הפעלה מערכות הפעלה

לחץ כאן לכל השאלות

Each process Pi, i = 0,1,2,3,……,9 is coded as follows. repeat P(mutex) {Critical Section} V(mutex) forever The code for P10 is identical except that it uses V(mutex) instead of P(mutex). What is the largest number of processes that can be inside the critical section at any moment (the mutex being initialized to 1)?

1
done
Explanation: Any one of the 9 processes can get into critical section after executing P(mutex) which decrements the mutex value to 0. At this time P10 can enter critical section by incrementing the value to 1. Now any of the 9 processes can enter the critical section by again decrementing the mutex value to 0. None of the remaining processes can get into their critical sections.
by
מיין לפי

* השאלה נוספה בתאריך: 20-07-2020