Madula posted an Question
June 19, 2022 • 12:46 pm 30 points
  • UGC NET
  • Computer Science & Applications

Ques. the atomic fetch and set x, y instruction unconditionallyv set the memory location x to i and fetches the value of x in y without allowing any intervening

Ques. The atomic fetch and set x, y instruction unconditionallyv set the memory location x to I and fetches the value of x in y Without allowing any intervening access to memory location x. Conider the following complemente on binary semaphore S. 1. Void P (binary semaphore* $){ TGATE 2006 Void V (binary semaphore * s) { 2. Unsigned y; Svalue = 0 ; 3. Unsigned * X =& (S >valve); do { fetch and set x, y; while (y); Which is true? (A) Implementation is correct if context switching is disabled in P. (B) Instead of fetch & set load/store can be used. (C) Implementation of V is wrong (D) Code does not implement binary semaphore Ans. (A) Let S = 0 By statement 3 x = 0 to x = 1 & y = 0. GonteXt Switching enabled, P doesn t work properly.

1 Answer(s) Answer Now
  • 0 Likes
  • 1 Comments
  • 0 Shares
  • Aparna 1 best-answer

    Here, correct answer is - Option A i.e. The implementation may not work, if context switching is disabled in P. For explanation, see.the attached file

    1..pdf
whatsapp-btn

Do You Want Better RANK in Your Exam?

Start Your Preparations with Eduncle’s FREE Study Material

  • Updated Syllabus, Paper Pattern & Full Exam Details
  • Sample Theory of Most Important Topic
  • Model Test Paper with Detailed Solutions
  • Last 5 Years Question Papers & Answers