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); }

Computer Science Gate CS-2013 in Computer Science 11 months ago

  15   0   0   0   0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 21 Jul 2024, this text provides information on Computer Science related to Gate CS-2013 in Computer Science. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Tuteehub forum answer Answers

Post Answer

No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.