Question: 6. (See textbook Exercise 2.5.3): Managing multi-unit resources. (12pts) (a) Extend the request and release functions to work with resources having multiple identical units. .

6. (See textbook Exercise 2.5.3): Managing multi-unit resources. (12pts) (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 function 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 function 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) 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? 6. (See textbook Exercise 2.5.3): Managing multi-unit resources. (12pts) (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 function 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 function 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) 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
Get step-by-step solutions from verified subject matter experts
