Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Consider the following solution, which is presented in guarded commands, to the readers-writers problem: void reader() void writer() when ( writers readers++; ) [

image text in transcribed
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

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_2

Step: 3

blur-text-image_3

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

Managing Your Information How To Design And Create A Textual Database On Your Microcomputer

Authors: Tenopir, Carol, Lundeen, Gerald

1st Edition

1555700233, 9781555700232

More Books

Students also viewed these Databases questions

Question

Discuss how technology is affecting marketing.

Answered: 1 week ago

Question

LO1 Understand risk management and identify its components.

Answered: 1 week ago