Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The dinning philosopher problem is one of the classical process synchronization problems, in which multiple processes simulate dinning philosophers. Multiple (N) philosophers are dining on
The dinning philosopher problem is one of the classical process synchronization problems, in which multiple processes simulate dinning philosophers. Multiple (N) philosophers are dining on a round table, on which N forks exist (as shown below). The N philosophers share the forks. Each philosopher, who is simulated by a process, needs two forks (one in his left and the other in his right) fork dish philosopher Consider the procedure put forks in the solution of the dining philosopher problem (attached at the second appendix (APPENDIX 2) of this exam question). Suppose that the variable state[i] was set to THINKING after the two calls to test, rather than before. How would this change affect the solution? First, select the best solution from the following choices (a) No effect (nothing will be changed) (b) Starvation (some philosophers can starve to death) (c) Deadlock (all the philosophers will be dead because of a possible deadlock) (d) Assign a fork to more than one philosopher at a time. Then, prove your choice by showing an example, if you select option (b), (c), or (d). If you select (a), explain why no effect. Note: "up" means "signal", while "down" means "wait" for semaphore operations The dinning philosopher problem is one of the classical process synchronization problems, in which multiple processes simulate dinning philosophers. Multiple (N) philosophers are dining on a round table, on which N forks exist (as shown below). The N philosophers share the forks. Each philosopher, who is simulated by a process, needs two forks (one in his left and the other in his right) fork dish philosopher Consider the procedure put forks in the solution of the dining philosopher problem (attached at the second appendix (APPENDIX 2) of this exam question). Suppose that the variable state[i] was set to THINKING after the two calls to test, rather than before. How would this change affect the solution? First, select the best solution from the following choices (a) No effect (nothing will be changed) (b) Starvation (some philosophers can starve to death) (c) Deadlock (all the philosophers will be dead because of a possible deadlock) (d) Assign a fork to more than one philosopher at a time. Then, prove your choice by showing an example, if you select option (b), (c), or (d). If you select (a), explain why no effect. Note: "up" means "signal", while "down" means "wait" for semaphore operations
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started