Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Processes P1and P2 use critical_flag in the f... Start Learning for Free
Processes P1 and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:

Consider the follow ing statements:
1. It is possible for both P1 and P2 to access critical_region concurrently.
2. This may lead to a deadlock.
Which of the following holds?
  • a)
    1 is false and 2 is true
  • b)
    Both 1 and 2 are false
  • c)
    1 is true and 2 is false
  • d)
    Both 1 and 2 are true
Correct answer is option 'C'. Can you explain this answer?
Verified Answer
Processes P1and P2 use critical_flag in the following routine to achie...
If after checking the condition (critical - flag == FALSE) P1 preempts without making critical flag TRUE and in turn gives option for P2 to check the condition and since critical - flag is FALSE till this point. P2 will also enter the if block and make the critical - flag as TRUE and start assessing critical -region ().
If P1 again comes back, it will start from time 2 directly and rewrite critical - flag as TRUE again and will start assessing critical - region (). So, it is possible for P1 and P2 to access critical - region concurrently.
Since, mutual exclusion is mandatory condition for deadlock, deadlock will never occur in this case. However, consistency can’t be ensured in such cases.
View all questions of this test
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect answer is option 'C'. Can you explain this answer?
Question Description
Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect 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 Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect 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 Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect answer is option 'C'. Can you explain this answer?.
Solutions for Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect 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 Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect answer is option 'C'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect answer is option 'C'. Can you explain this answer?, a detailed solution for Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect answer is option 'C'. Can you explain this answer? has been provided alongside types of Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect answer is option 'C'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Processes P1and P2 use critical_flag in the following routine to achieve mutual exclusion. Assume that critical_flag is initialized to FALSE in the main program:Consider the follow ing statements:1.It is possible for both P1 and P2 to access critical_region concurrently.2.This may lead to a deadlock.Which of the following holds?a)1 is false and 2 is trueb)Both 1 and 2 are falsec)1 is true and 2 is falsed)Both 1 and 2 are trueCorrect answer is option 'C'. Can you explain this answer? tests, examples and also practice Computer Science Engineering (CSE) tests.
Explore Courses for Computer Science Engineering (CSE) exam

Top Courses for Computer Science Engineering (CSE)

Explore Courses
Signup for Free!
Signup to see your scores go up within 7 days! Learn & Practice with 1000+ FREE Notes, Videos & Tests.
10M+ students study on EduRev