Skip to content
Official PYQ · 2013

GATE CS 2013 Q39 — Concurrency and Synchronization

Explain with AI

A certain computation generates two arrays a and b such that a[i]=f(i)a[i] = f(i) for 0≤i<n0 \leq i < n and b[i]=g(a[i])b[i] = g(a[i]) for 0≤i<n0 \leq i < n. Suppose this computation is decomposed into two concurrent processes XX and YY such that XX computes the array aa and YY computes the array bb. The processes employ two binary semaphores RR and SS, both initialized to zero. The array aa is shared by the two processes. The structures of the processes are shown below.

Process X:

private i; 
for (i=0; i< n; i++) { 
 a[i] = f(i); 
 ExitX(R, S); 
} 

Process Y:

private i;
for (i=0; i< n; i++) { 
  EntryY(R, S); 
  b[i] = g(a[i]); 
}

Which one of the following represents the CORRECT implementations of ExitX and EntryY?

Choose one option
View answer

Answer: C

Worked explanation not available yet.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Concurrency and Synchronization questions