Question: Manage mult - unit resources a ) Extend the request and release functions to work with resources having multiple identical units. p . other _

Manage mult-unit resources
a) Extend the request and release functions to work with resources having multiple identical units.
p.other_resources is a list of pairs (r, k) where r is a resource and k is the number of units that p is holding.
r.state is a counter that keeps track of the currently available units of r.
r.waiting_list contains pairs (p, k) where p is the waiting process and k is the number of requested units.
The request functions has the form request(r, k) where r is the resource and k is the number of units. To simplify the algorithm, a process may request units of the same resource only once.
The release functions has the form release(r) where r is the resource. All k units of r are released at the same time.
Note that a release of k units may enable more than one process from r.waiting_list.
b) A process could remain stuck in r.waiting_list forever if the number of units requested exceeds the total number of units available initially in r. How could that problem be prevented?
c) Problem Nine: A process p could starve by being skipped over by processes arriving after p but requesting smaller numbers of units than p. How could that problem be prevented?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!