Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

image text in transcribedimage text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions