Question 11
Question 12
Question 13
Method Used by P1 while (S1 == S2) ; Critica1 Section S1 = S2; Method Used by P2 while (S1 != S2) ; Critica1 Section S2 = not (S1);Which one of the following statements describes the properties achieved?
Question 14
Question 15
void enter_CS(X) { while test-and-set(X) ; } void leave_CS(X) { X = 0; }In the above solution, X is a memory location associated with the CS and is initialized to 0. Now consider the following statements: I. The above solution to CS problem is deadlock-free II. The solution is starvation free. III. The processes enter CS in FIFO order. IV More than one process can enter CS at the same time. Which of the above statements is TRUE?
Question 16
P(s) : s = s - 1; if (s < 0) then wait; V(s) : s = s + 1; if (s <= 0) then wakeup a process waiting on s;Assume that Pb and Vb the wait and signal operations on binary semaphores are provided. Two binary semaphores Xb and Yb are used to implement the semaphore operations P(s) and V(s) as follows:
P(s) : Pb(Xb); s = s - 1; if (s < 0) { Vb(Xb) ; Pb(Yb) ; } else Vb(Xb); V(s) : Pb(Xb) ; s = s + 1; if (s <= 0) Vb(Yb) ; Vb(Xb) ;The initial values of Xb and Yb are respectively
Question 17
for (i = 0; i < n; i++) fork();The total number of child processes created is
Question 18
Question 19
/* P1 */ while (true) { wants1 = true; while (wants2 == true); /* Critical Section */ wants1=false; } /* Remainder section */ /* P2 */ while (true) { wants2 = true; while (wants1==true); /* Critical Section */ wants2 = false; } /* Remainder section */
There are 115 questions to complete.