Question: Just need the answer for c, and pls code in c programming language. Thank you. (80%) Programming problem 6.33 from the 10th edition with modifications.

 Just need the answer for c, and pls code in cprogramming language. Thank you. (80%) Programming problem 6.33 from the 10th edition

Just need the answer for c, and pls code in c programming language. Thank you.

(80%) Programming problem 6.33 from the 10th edition with modifications. Assume that a finite number of resources of a single resource type must be managed. Processes may ask for a number of these resources and will return them once finished. As an example, many commercial software packages provide a given number of licenses, indicating the number of applications that may run concurrently. When the application is started, the license count is decremented. When the application is terminated, the license count is incremented. If all licenses are in use, requests to start the application are denied. Such a request will be granted only when an existing license holder terminates the application and a license is returned. The following program segment is used to manage a finite number of instances of an available resource. The maximum number of resources and the number of available resources are declared as follows: #define MAX_RESOURCES 5 int available_resources = MAX_RESOURCES; /** When a process wishes to obtain a number of resources, it invokes the * decrease_count() function: * /* decrease available_resources by count resources */ /* return Oif sufficient resources available. */ /* otherwise return-1 */ int decrease_count(int count) { if (available_resources MAX_RESOURCES. Output should be the results from each call. For example, a MAX_RESOURCES of 5 with 3 calls would result in the following: ./a.out 5 -4 -2 2 0,-1, 0

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 Databases Questions!