solve philosopher’s dining problem variant
Consider a variant of the philosopher’s dining problem: all chopsticks are placed in the middle of the table, and when a philosopher eats, he only needs to take any two chopsticks from it, and then put them back in the middle after eating. One way to avoid deadlocks is to provide sufficient resources. So if there are N philosophers, how many chopsticks do they need to provide to avoid deadlock problems? Why?