1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Sedaia [141]
3 years ago
10

Assume that a finite number of resources of a single resource type must be managed. Processes may ask for a number of these reso

urces and —once finished—will return them. As an example, many commercial software packages provide a given number of licenses, indicating the number of applications that may run concurrently. When the applicationis 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 requests will only be granted 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 5int 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 0 if sufficient resources available, *//* otherwise return -1 */int decrease_count(int count) {if (available resources < count)return -1;else {available resources -= count;return 0;}}When a process wants to return a number of resources, it calls the increase_count() function:/* increase available resources by count */int increase_count(int count) {available resources += count;return 0;}The preceding program segment produces a race condition. Do the following:Identify the location and variables involved in the race condition and use a semaphore to fix the race condition.
Computers and Technology
1 answer:
nevsk [136]3 years ago
5 0
The answer may not be found
You might be interested in
John’s grandparents make wine for special occasions. They add a pinch of yeast to crushed grapes. Over time, this action release
luda_lava [24]
The answer is 1. A<span>lcoholic Fermentation

Hope that helped :)</span>
4 0
3 years ago
Read 2 more answers
Your worksheet has the value 27 in cell B3. What value is<br>returned by the function =MOD(B3,6)?​
Digiron [165]

Answer:

3

Explanation:

MOD means the remainder after a division calculation.

\frac{27}{6}= 4r3

The remainder is 3

5 0
3 years ago
How many days has trump been a president
Free_Kalibri [48]
Hey there
_______________
The correct answer is
1 year, 64 days, 13 hours, 11 minutes and 44 seconds

__________
Hope this helps you
8 0
3 years ago
Read 2 more answers
What are characteristics of fluent readers? Check all that apply. reading known words automatically pronouncing words correctly
IRINA_888 [86]

Answer:

D,A,B hope this is it!!!!!

7 0
2 years ago
Read 2 more answers
Consider the following code: x=random.randint (1, 100) The randint is a ____.​
Mrrafil [7]
Random integer, in this case betweeen 1 and 100
5 0
3 years ago
Other questions:
  • Heatsinks used to protect cpus in computers from overheating, are shaped so that their surface area is very large. why is that?
    5·1 answer
  • Which is the most efficient way to italicize a row of text in every worksheet in a workbook?
    8·1 answer
  • Help!!!!!!!!!!!!!!!!!!!
    12·1 answer
  • A(n) _____ can be used to convert digitized documents into ascii (american standard code for information interchange) text that
    6·1 answer
  • _______ allow(s) you to apply colorful, eye catching designs to a presentation all at once. A. Themes B. Slide orientation C. Th
    10·2 answers
  • When a person or organization uses the services of another professional, that person or organization is called the _______
    15·1 answer
  • Whixh options are available when a user modifies a recurring appointment. Check all that apply
    12·1 answer
  • In what way, if any, has community building changed in the age of digital media? People’s community building has not changed in
    13·1 answer
  • Dr. Wayne is trying to developing techniques to cure Parkinson’s disease by inserting genetic material into patients’ cells to c
    12·1 answer
  • You can not give an exact size for a height for column width true or false
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!