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
Assume that minutes is an int variable whose value is 0 or positive. Write an expression whose value is "undercooked" or "soft-b
e-lub [12.9K]

Answer:

import java.util.Scanner;

public class Solution {

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     System.out.println("Enter your minute:");

     int minute = scan.nextInt();

     

     switch(minute){

         case 0:

         case 1:

             System.out.println("undercooked");

             break;

         case 2:

         case 3:

         case 4:

             System.out.println("soft-boiled");

             break;

         case 5:

         case 6:

         case 7:

             System.out.println("medium-boiled");

             break;

         case 8:

         case 9:

         case 10:

         case 11:

             System.out.println("hard-boiled");

             break;

         case 12:

             System.out.println("overcooked");

             break;

         default:

             if(minute > 12){

               System.out.println("overcooked");

             } else if (minute < 0){

                 System.out.println("Enter a valid minute.");

             }            

     }

   }

}

Explanation:

The first line is the import statement, which import the Scanner class for receiving user input. The next line is the class declaration which is named Solution.

The Scanner object is declared and assigned as scan. Then a prompt is displayed to the user asking the user to enter the minute. The user input is stored as minute.

Switch statement is use to categorize the user input. If the user enter 0-1, an output of undercooked is displayed. If the user enter 2-4, an output of soft-boiled is displayed. If the user enter 5-7, an output of medium-boiled is displayed. If the user enter 12 or any number above 12, an output of overcooked is displayed. Again, the user enter a number less than zero, an error message is displayed telling the user to enter a valid number.

4 0
2 years ago
The person who receives an e-mail​
Hunter-Best [27]
I believe the answer to your question is email recipient!!
5 0
3 years ago
In the 219th meeting of the American Astronomical Society, what planet's borders were said to be recognizable from space? Hint:
Naily [24]

<span>In the 219th meeting of the American Astronomical Society, it was said that "Earth" is the plant that's borders were recognizable from space. 
</span>Former NASA astronaut John Grunsfeld said that these are visible in the form of environmental differences.

<span>He busted a myth also that The Great Wall of China is visible from space, he denied it.</span>

8 0
3 years ago
The Internet has allowed media companies to synergize their content, broadcasting the same ideas and products across multiple pl
borishaifa [10]

Answer:

First copy cost is the correct answer for the given question.

Explanation:

Because the cost of the first copy is less and they are a high-quality product and is also a similar copy of the original copy with features.

Duplicate copies have less in cost but their qualities are not better than that first copies because they are the coy of the original ones but the margin is higher in the duplicate copies.

In simple words, first copies have look similar to the original ones but their quality is cheaper and their production cost and selling costs are also cheap as compared to the original ones.

8 0
3 years ago
A record company is using blockchain to manage the ownership of their copyrighted content. The company requires that every time
Fantom [35]

By creating a smart contract to calculate party royalties

8 0
2 years ago
Other questions:
  • Attacking systems by exploiting otherwise unknown and unpatched vulnerabilities is also known as:
    8·1 answer
  • After you select your recipients, the next step in using the Mail Merge Wizard would be to _____.
    6·2 answers
  • What is one piece of equipment every food establishment needs?
    10·1 answer
  • 1. In the.js file, write the JavaScript code for this application. Within the click event handlers for the elements in the sideb
    14·1 answer
  • En que parte del mall del rio venden tarjetas de google play en cuenca​
    7·1 answer
  • Compare Fibonacci (recursion vs. bottom up)
    12·1 answer
  • What is the first step that you have to perform before you can add a windows package to a wim file?
    9·1 answer
  • Using the Caesar cipher, "HELLO" is encrypted to "OLSSV" by applying a shift of 7. The number 7 is considered the __________
    5·1 answer
  • Write long answer to the following question. a. Define microcomputer. Explain the types of microcomputers in detail.​
    5·2 answers
  • Your company requires computers to authenticate to one another and enforces this requirement with Windows Defender Firewall with
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!