Consider the following proposed solution to Dining Philosopher’s problem to avoid deadlock. The binary semaphore lock is initialized to 1.
Which of the following is correct?
- Removing (i) and (ii) will not affect the code. It will work fine.
- Removing (iii) and (iv) will not affect the code. It will work fine.
- Removing (i), (ii), (iii) and (iv) will not affect the code. It will work fine.
- All (i), (ii), (iii) and (iv) are necessary. Removal of any of them will affect the code.