Question: 1. Consider the following solution, which is presented in guarded commands, to the readers-writers problem: void reader() void writer() when ( writers readers++; ) [
1. Consider the following solution, which is presented in guarded commands, to the readers-writers problem: void reader() void writer() when ( writers readers++; ) [ when ( (readers writers++; e) && (writers ) )[ //read //write [readers--;] [writers--] What is the shortcoming of this solution? A. O It might not synchronize readers and writers threads. B. It might cause deadlock C. O It might allow more than one writer to write at the same time. D. O It might cause starvation of the writers. E.It might not allow more than two readers to read at the same time. 2. In the above question, how could one correct the defect of the solution? A. O assigning higher priorities to the readers B. O assigning higher priorities to the writers C. O using a shortest-job-first policy D. O using a first-come-first-served policy E. allowing more than one reader to read at the same time 3. What are the four necessary conditions for deadlock to occur in a system? (Check four.) A. starvation B. mutual exclusion C. no preemption D. hold-and-wait E. more processes than resources F. circular wait 4. Fill in the blank. (Your answer must be all lower-case letters with correct spelling and grammar. Do not enter any punctuation mark.) In a resource allocation graph, if it does not contain any no process is in deadlock
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
