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
katrin [286]
3 years ago
14

Consider a system consisting of processes P1 , P2 , ..., Pn , each of which has a unique priority number. Write a monitor that a

llocates three identical printers to these processes, using the priority numbers for deciding the order of allocation.
Computers and Technology
1 answer:
adelina 88 [10]3 years ago
7 0

Answer:

See explaination

Explanation:

The code

type printer = monitor

var P: array[0…2] of boolean;

X: condition;

procedure acquire (id: integer, printer-id: integer);

begin

if P[0] and P[1] and P[2] then X.wait(id)

if not P[0] then printer-id := 0;

else if not P[1] then printer-id := 1;

else printer-id := 2;

P[printer-id]:=true;

end;

procedure release (printer-id: integer)

begin

P[printer-id]:=false;

X.signal;

end;

begin

P[0] := P[1] := P[2] := false;

end ;

Note:

Monitors are implemented by using queues to keep track of the processes attempting to become active int he monitor. To be active, a monitor must obtain a lock to allow it to execute the monitor code. Processes that are blocked are put in a queue of processes waiting for an unblocking event to occur.

You might be interested in
What information does a Transform hold? (Choose all that apply)
never [62]

Answer:

Each object stores its position, orientation, and scale values.

Explanation:

5 0
4 years ago
Which of the following statements best represents the pros and cons of being a solitary artist?
qaws [65]
I strongly believe the third option best describes the pros and cons of being a solo artists apart form the fact it is the one option that makes more sense to me.


Hope it helped,

Happy homework/ study/ exam!
5 0
3 years ago
Read 2 more answers
Assume you're using a three button mouse. to access shortcut menus, you would
Likurg_2 [28]
<span>Normally you would click the right hand/secondary mouse button but you may configure any of the buttons to work within the Keyboard and Mouse section of System Preferences.
Hope this helps:)</span>
6 0
3 years ago
Read 2 more answers
Duolcgnitupmoc unscramble the word​
ahrayia [7]

Answer:

The word is computing cloud, since the topic is from computers and technology, and the whole word is backwards.

6 0
3 years ago
Read 2 more answers
The modulus ( % ) actually gives you the ___________ of an integer division problem.
Svetlanka [38]
The answer is (e) sum
7 0
4 years ago
Other questions:
  • Which of the following rules should be used to keep the appropriate distance between your vehicle and the vehicle in front of yo
    10·2 answers
  • A 9-year old male castrated Westie presents on emergency after being rescued from a house fire. On presentation, the dog has a r
    14·1 answer
  • The _______ is the continuing development of the internet that allows everyday objects embedded with electronic devices to send
    11·1 answer
  • ammy's Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas to tourists. Write a program
    13·1 answer
  • What information is stored in the file system?
    5·1 answer
  • Passwords are usually alphanumeric and usually cannot contain spaces or ________.
    10·2 answers
  • a hacker who plants a rogue wireless access point on a network in order to sniff the traffic on the wired network from outside t
    12·1 answer
  • What is emerging as a major business area of innovation that offers a flexible collection of computers on the Internet that can
    9·1 answer
  • Which is used for making documentation file from microsoft office package​
    11·2 answers
  • Cookie Snooping
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!