Question Description
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]);} }Q.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 Computer Science Engineering (CSE) 2025 is part of Computer Science Engineering (CSE) preparation. The Question and answers have been prepared
according to
the Computer Science Engineering (CSE) exam syllabus. Information about 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]);} }Q.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 Computer Science Engineering (CSE) 2025 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 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]);} }Q.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 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]);} }Q.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 Computer Science Engineering (CSE).
Download more important topics, notes, lectures and mock test series for Computer Science Engineering (CSE) 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 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]);} }Q.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 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]);} }Q.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 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]);} }Q.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 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]);} }Q.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 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]);} }Q.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 Computer Science Engineering (CSE) tests.