Sargam posted an Question
May 19, 2022 • 19:31 pm 30 points
  • UGC NET
  • Computer Science & Applications

Ques. iwo process x &y necd to access a cs. consider the following - processy process x while (tue) var q = true. var p= true; while (var p = = true) while (var

Ques. Iwo Process X &y necd to access a CS. Consider the following - Processy Process X while (tue) Var Q = true. var P= true; while (Var P = = true) while (Var Q = = true) CS CS Var P = false Var Q = false Here varP and varQ are shared variables and both are initialized to false. Which one of the (A) Proposed solution guarantee that there is no deadlock but no mutual exclusion. (B) It guarantees mutual exclusion but fails to prevent deadlock (C) guarantees both deadlock and mutual exclusion.

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

    When both processes try to enter critical section simultaneously , both are allowed to do so since both shared variables var P and var Q are true. So it is very clear that there is No Mutual Exclusion here. As both processes can enter in the critical section at the same time, mutual exclusion is not satisfied. Also deadlock is prevented because mutual exclusion is one of the necessary condition for deadlock to happen. Hence correct option is A i.e. proposed solution guarantees that there is no deadlock but mutual exclusion.

    cropped8615065390791220915.jpg
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