5 votes 5 votes In dining philosophers Algorithm the minimum number of forks or chopsticks to avoid deadlock is (assume there are 5 philosophers) a. 5 b. 6 c. 10 d. None of these Operating System operating-system + – Suman Acharya asked Sep 13, 2017 Suman Acharya 4.3k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 5 votes 5 votes Answer is B all 5 philosopher will take 1 fork each and then remaining one fork can be taken by any philosopher hence total (5+1)=6 nikunj answered Sep 13, 2017 selected Nov 4, 2017 by Manu Thakur nikunj comment Share Follow See all 7 Comments See all 7 7 Comments reply Suman Acharya commented Sep 13, 2017 reply Follow Share Sir If we use 6 forks or chopsticks we can prevent deadlock 0 votes 0 votes nikunj commented Sep 13, 2017 reply Follow Share If we distribute 5 forks among the philosophers then all of them will wait for 1 more so for deadlock condition is 5 and if we provide one more then there will be no deadlock because any philosopher will take the 6th fork and after eating it will return both its fork which will be distributed among the other philosopher hence no deadlock 0 votes 0 votes hs_yadav commented Sep 13, 2017 reply Follow Share but if we consider the algorithm ...then 5 forks are enough to resolve the problem.... 0 votes 0 votes joshi_nitish commented Sep 13, 2017 reply Follow Share @hs_yadav 5 forks will lead to deadlock, either increase one fork(5+1=6) or decrease one philospher(5-1=4) will gurantee no deadlock.. 1 votes 1 votes hs_yadav commented Sep 13, 2017 reply Follow Share then i think it would be a simple dead lock problem not a dining philospher prob... as in the case of DP problem every philospher first took the left fork and then right fork(it leads a problem) but if we restrict one philospher i.e first it will took right and then left ... then i think 5 forks will not lead to deadlock.... 0 votes 0 votes A_i_$_h commented Sep 13, 2017 reply Follow Share if 5 philosophers take one fork each now they all will wait for one more fork because they wont release their forks until they get both so u need 6 to break that 1 votes 1 votes nikunj commented Sep 13, 2017 reply Follow Share @hs_yadav yes for sure this is not standard dining philosopher problem because in that standard problem already all the forks would be given by default and here in the name of philosopher it is easy and straight forward question is given 0 votes 0 votes Please log in or register to add a comment.