Loading
-
529.
-
530.
Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores Sx and Sy respectively, both initialized to 1. P and V denote the usual semaphore operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows:
P1: P2: While true do {
L1: …………………..
L2: …………………..
X = X + 1;
Y = Y – 1;
V(Sx);
V(Sy); }While true do {
L3: …………………..
L4: …………………..
Y = Y + 1;
X = Y – 1;
V(Sy);
V(Sx);
(a) P(Sy), P(Sx); P(Sx), P(Sy)
(b) P(Sx), P(Sy); P(Sy), P(Sx)
(c) P(Sx), P(Sx); P(Sy), P(Sy)
(d) P(Sx), P(Sy); P(Sx), P(Sy)asked in Computer Science And Engineering, 2004
View Comments [0 Reply]
-
531.
-
532.
Consider the following set of processes, with the arrival times and the CPU-burst times given in milliseconds.
Process Arrival Time Burst Time P1 0 5 P2 1 3 P3 2 3 P4 4 1
(a) 5.50
(b) 5.75
(c) 6.00
(d) 6.25
asked in Computer Science And Engineering, 2004
View Comments [0 Reply]
-
533.
-
534.