in Operating System edited by
6,441 views
21 votes
21 votes

Consider the following two scenarios in the dining philosophers problem:

  1. First a philosopher has to enter a room with the table that restricts the number of philosophers to four.
  2. There is no restriction on the number of philosophers entering the room.

Which of the following is true?

  1. Deadlock is possible in (i) and (ii).
  2. Deadlock is possible in (i).
  3. Starvation is possible in (i).
  4. Deadlock is not possible in (ii).
  5. Starvation is not possible in (ii)
in Operating System edited by
6.4k views

2 Comments

starvation is possible in i
5
5
0
0

5 Answers

1 vote
1 vote

In dining phyloshopher problem , if the number of phyloshopher is 4 and number of fork is 5, then atleast one fork which is extra , that place 2 philoshopher is not sharing any fork.
 So, circular wait violating. and deadlock not possible. But yes starvation always possible. As each philoshopher have atleast one fork sharing with other.

Now for (ii) unrestricted number of philoshopher is there. and there are only 5 forks. So, each phyloshopher must share their forks. So, Deadlock is obvious there.

4 Comments

How can you take the number of philosphers as 4 and number of fork as 5? Nothing about forks is mentioned.
0
0
But it is mentioned as dining phyloshopher problem

In dining phyloshopher problem(if no code is given) we generally think about 5 phyloshopher and 5 fork
0
0
So if in the question there were just 2 or 3 philosophers too then too we would consider 5 forks?
1
1
In (II) part there is no limit of philosophers given then also u considered 5 forks are there. How?
0
0
Answer:

Related questions