Question Description
A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer? for GATE 2024 is part of GATE preparation. The Question and answers have been prepared
according to
the GATE exam syllabus. Information about A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer? covers all topics & solutions for GATE 2024 Exam.
Find important definitions, questions, meanings, examples, exercises and tests below for A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer?.
Solutions for A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer? in English & in Hindi are available as part of our courses for GATE.
Download more important topics, notes, lectures and mock test series for GATE Exam by signing up for free.
Here you can find the meaning of A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of
A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer?, a detailed solution for A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer? has been provided alongside types of A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer? theory, EduRev gives you an
ample number of questions to practice A certain computation generates two arrays a and b such that a[i] = f (i) for 0 i < n andb[i] = g (a [i]) for 0 i < n . Suppose this computation is decomposed into two concurrentprocesses X and Y such that X computes the array a and Y computes the array b. Theprocesses employ two binary semaphores R and S, both initialized to zero. The array a isshared 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?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);}Correct answer is option 'C'. Can you explain this answer? tests, examples and also practice GATE tests.