Computer Science Engineering (CSE) Exam  >  Computer Science Engineering (CSE) Questions  >  Consider the following proposed solution for ... Start Learning for Free
Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.
Which one of the following is TRUE about the above solution?
  • a)
    At most one process can be in the critical section at any time
  • b)
    The bounded wait condition is satisfied
  • c)
    The progress condition is satisfied
  • d)
    It cannot cause a deadlock
Correct answer is option 'A'. Can you explain this answer?
Verified Answer
Consider the following proposed solution for the critical section prob...
Mutual exclusion  is satisfied:
All other processes j started before i must have value (i.e. t[j]) less than the value of process i (i.e. t[i])  as function pMax() return a integer not smaller  than any of its arguments. So if anyone out of the processes j have positive value will be executing in its critical section as long as the condition t[j] > 0 && t[j] <= t[i] within while will persist. And when  this j process comes out of its critical section, it sets t[j] = 0;  and next process will be selected in for loop.
So when i process reaches to its critical section none of the  processes j which started earlier before process i  is in its critical section. This ensure that only one process is executing its critical section at a time. 
Deadlock and progress are  not satisfied:  
while (t[j] != 0 && t[j] <=t[i]); because of this condition deadlock is possible when value of j process becomes equals to the value of process i (i.e t[j] == t[i]).  because of the deadlock progess is also not possible (i.e. Progess == no deadlock) as no one process is able to make progress by stoping other process. 
Bounded waiting is also not satisfied: 
In this case both deadlock and bounded waiting to be arising from the same reason as if t[j] == t[i] is possible then starvation is possible means infinite waiting.
View all questions of this test
Most Upvoted Answer
Consider the following proposed solution for the critical section prob...
Mutual exclusion  is satisfied:
All other processes j started before i must have value (i.e. t[j]) less than the value of process i (i.e. t[i])  as function pMax() return a integer not smaller  than any of its arguments. So if anyone out of the processes j have positive value will be executing in its critical section as long as the condition t[j] > 0 && t[j] <= t[i] within while will persist. And when  this j process comes out of its critical section, it sets t[j] = 0;  and next process will be selected in for loop.
So when i process reaches to its critical section none of the  processes j which started earlier before process i  is in its critical section. This ensure that only one process is executing its critical section at a time. 
Deadlock and progress are  not satisfied:  
while (t[j] != 0 && t[j] <=t[i]); because of this condition deadlock is possible when value of j process becomes equals to the value of process i (i.e t[j] == t[i]).  because of the deadlock progess is also not possible (i.e. Progess == no deadlock) as no one process is able to make progress by stoping other process. 
Bounded waiting is also not satisfied: 
In this case both deadlock and bounded waiting to be arising from the same reason as if t[j] == t[i] is possible then starvation is possible means infinite waiting.
Explore Courses for Computer Science Engineering (CSE) exam

Similar Computer Science Engineering (CSE) Doubts

Top Courses for Computer Science Engineering (CSE)

Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. Can you explain this answer?
Question Description
Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. 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 the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. 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 the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. Can you explain this answer?.
Solutions for Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. 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 the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. Can you explain this answer? defined & explained in the simplest way possible. Besides giving the explanation of Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. Can you explain this answer?, a detailed solution for Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. Can you explain this answer? has been provided alongside types of Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. Can you explain this answer? theory, EduRev gives you an ample number of questions to practice Consider the following proposed solution for the critical section problem. There are n processes: P0 ...Pn−1. In the code, function pmax returns an integer not smaller than any of its arguments. For all i, t[i] is initialized to zero.Which one of the following is TRUE about the above solution?a)At most one process can be in the critical section at any timeb)The bounded wait condition is satisfiedc)The progress condition is satisfiedd)It cannot cause a deadlockCorrect answer is option 'A'. 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