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
Assume there is a class AirConditioner that supports the following behaviors: turning the air conditioner on and off, and checki
vaieri [72.5K]

Answer:

yes?

Explanation:

8 0
2 years ago
_______________ is used by a hacker to mask intrusion and obtain administrator permissions to a computer.
Sergeu [11.5K]

Answer:

Rootkit.

Explanation:

Rootkit is a collection of software tools,mostly malicious.These are mostly used by hackers to obtain administrator permission to a computer by masking intrusion.

Root-kit is made from two word Root and kit.Where root refers to the name of privileged account on an operating system that is somewhat like unix and KIT refers to the tools used.

6 0
3 years ago
Can a 3048 hp motherboard support a i7 10700k cpu?
KonstantinChe [14]

Answer:

Yes

Explanation:

6 0
2 years ago
Read 2 more answers
Which of these is not one of the main parts of an email?
pav-90 [236]
The header is not a main part of the email. 
3 0
3 years ago
Read 2 more answers
Give reasons why you care for your sense organs​
Cerrena [4.2K]

HI!the resaon why should you care for you sense organs is that they help us to contact with our surroundings.

8 0
2 years ago
Read 2 more answers
Other questions:
  • You bought a monochrome laser printer two years ago. The printer has gradually stopped feeding paper. Which printer component sh
    14·1 answer
  • Change control in application development is a formal process for changing written documentation into online documentation, and
    13·1 answer
  • A(n ________ is a program that is used to create, process, and administer a collection of self-describing integrated records.
    14·1 answer
  • An indirect effect of an action, be it a cost or benefit, for a third party who did not agree to the action is known as a(n) ___
    8·1 answer
  • Why should characters be avoided in file names
    11·1 answer
  • In a typical e-mail address, what is the "host"? A. an account designated by a user name. B. the computer that houses an Interne
    7·1 answer
  • To improve readability,______ use text on a dark green background.
    11·2 answers
  • WHAT DOES THE SCRATCH CODE BELOW DO?
    7·1 answer
  • Have y’all enjoyed The new hero floryn from Mobile legends
    6·1 answer
  • How to count the total number of users from backend reactjs.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!