Question Description
Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. Can you explain this answer? for Computer Science Engineering (CSE) 2024 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 Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. Can you explain this answer? covers all topics & solutions for Computer Science Engineering (CSE) 2024 Exam.
Find important definitions, questions, meanings, examples, exercises and tests below for Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. Can you explain this answer?.
Solutions for Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. 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 Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of
Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. Can you explain this answer?, a detailed solution for Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. Can you explain this answer? has been provided alongside types of Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. Can you explain this answer? theory, EduRev gives you an
ample number of questions to practice Consider two processes P1 and P2 accessing the shared variables X and Y protected by two binary semaphores SX and SY respectively, both initialized to 1. P and V denote the usual semaphone operators, where P decrements the semaphore value, and V increments the semaphore value. The pseudo-code of P1 and P2 is as follows : P1 :While true do { L1 : ................ L2 : ................ X = X + 1; Y = Y - 1; V(SX); V(SY);}P2 :While true do {L3 : ................L4 : ................Y = Y + 1;X = Y - 1;V(SY);V(SX);}Q.In order to avoid deadlock, the correct operators at L1, L2, L3 and L4 are respectivelya)P(SY), P(SX); P(SX), P(SY)b)P(SX), P(SY); P(SY), P(SX)c)P(SX), P(SX); P(SY), P(SY)d)P(SX), P(SY); P(SX), P(SY)Correct answer is option 'D'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.