GATE_CSE3 Telegram 4647
Forwarded from Deleted Account
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. Suppose this computation is decomposed into two concurrent processes X and Y such that X computes the array a and Y computes the array b. The processes employ two binary semaphores R and S, both initialized to zero. The array a is shared by the two processes. The structures of the processes are shown below.
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?

(A)
ExitX(R, S) {

P(R);

V(S);

}



EntryY (R, S) {

P(S);

V(R);

}
(B)
ExitX(R, S) {

V(R);

V(S);

}



EntryY(R, S) {

P(R);

P(S);

}
(C)
ExitX(R, S) {

P(S);

V(R);

}

EntryY(R, S) {

V(S);

P(R);

}

(D)
ExitX(R, S) {

V(R);

P(S);

}

EntryY(R, S) {

V(S);

P(R);

}



tgoop.com/gate_cse3/4647
Create:
Last Update:

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. Suppose this computation is decomposed into two concurrent processes X and Y such that X computes the array a and Y computes the array b. The processes employ two binary semaphores R and S, both initialized to zero. The array a is shared by the two processes. The structures of the processes are shown below.
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?

(A)
ExitX(R, S) {

P(R);

V(S);

}



EntryY (R, S) {

P(S);

V(R);

}
(B)
ExitX(R, S) {

V(R);

V(S);

}



EntryY(R, S) {

P(R);

P(S);

}
(C)
ExitX(R, S) {

P(S);

V(R);

}

EntryY(R, S) {

V(S);

P(R);

}

(D)
ExitX(R, S) {

V(R);

P(S);

}

EntryY(R, S) {

V(S);

P(R);

}

BY Computer Science quiz


Share with your friend now:
tgoop.com/gate_cse3/4647

View MORE
Open in Telegram


Telegram News

Date: |

Unlimited number of subscribers per channel Telegram desktop app: In the upper left corner, click the Menu icon (the one with three lines). Select “New Channel” from the drop-down menu. SUCK Channel Telegram Polls Telegram message that reads: "Bear Market Screaming Therapy Group. You are only allowed to send screaming voice notes. Everything else = BAN. Text pics, videos, stickers, gif = BAN. Anything other than screaming = BAN. You think you are smart = BAN.
from us


Telegram Computer Science quiz
FROM American