GATEverse Practice, past papers & mock tests
GATE 2013 · session-1
Operating SystemsProcess Management-IIhardMCQ2 marks
A certain computation generates two arrays a and b such that a[i]=f(i) for 0?i<n and b[i]=g(a[i]) for 0?i<n. It is decomposed into two concurrent processes X and Y: X computes a and Y computes b. They employ two binary semaphores R and S, both initialized to zero. Array a is shared. The process structures are:
text
Process X:                         Process Y:
private i;                         private i;
for (i = 0; i < n; i++) {          for (i = 0; i < n; i++) {
    a[i] = f(i);                       EntryY(R, S);
    ExitX(R, S);                       b[i] = g(a[i]);
}                                  }
Which one of the following represents the CORRECT implementations of ExitX and EntryY?
Save your progress

Related Operating Systems PYQs