SlideShare a Scribd company logo
Consider a system consisting of processes P1, P2, ... , P11, each of which has a unique priority
number. Write a monitor that allocates three identical line printers to these processes, using the
priority numbers for deciding the order of allocation.
Solution
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.
The code for monitor is as follows:
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 ;
Consider a system consisting of processes P1- P2- --- - P11- each of w.docx

More Related Content

Similar to Consider a system consisting of processes P1- P2- --- - P11- each of w.docx

ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.ppt
Mahyuddin8
 
OS Process synchronization Unit3 synchronization
OS Process synchronization Unit3  synchronizationOS Process synchronization Unit3  synchronization
OS Process synchronization Unit3 synchronization
subhamchy2005
 
Bakery algorithm
Bakery algorithmBakery algorithm
Bakery algorithm
Um e Farwa
 
The java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdfThe java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdf
akaluza07
 
C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2
Zaibi Gondal
 
Python programming Workshop SITTTR - Kalamassery
Python programming Workshop SITTTR - KalamasseryPython programming Workshop SITTTR - Kalamassery
Python programming Workshop SITTTR - Kalamassery
SHAMJITH KM
 
Linux Systems Programming: Process CommunCh11 Processes and Signals
Linux Systems Programming: Process CommunCh11 Processes and SignalsLinux Systems Programming: Process CommunCh11 Processes and Signals
Linux Systems Programming: Process CommunCh11 Processes and Signals
RashidFaridChishti
 
ALGO.ppt
ALGO.pptALGO.ppt
ALGO.ppt
PidoonEsm
 
CP4151 ADSA unit1 Advanced Data Structures and Algorithms
CP4151 ADSA unit1 Advanced Data Structures and AlgorithmsCP4151 ADSA unit1 Advanced Data Structures and Algorithms
CP4151 ADSA unit1 Advanced Data Structures and Algorithms
Sheba41
 
CH05.pdf
CH05.pdfCH05.pdf
CH05.pdf
ImranKhan880955
 
Fundamentals of Programming Chapter 3
Fundamentals of Programming Chapter 3Fundamentals of Programming Chapter 3
Fundamentals of Programming Chapter 3
Mohd Harris Ahmad Jaal
 
Lab-11-C-Problems.pptx
Lab-11-C-Problems.pptxLab-11-C-Problems.pptx
Lab-11-C-Problems.pptx
ShimoFcis
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process SynchronizationSonali Chauhan
 
Chapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationChapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationWayne Jones Jnr
 
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
To Sum It Up
 
Practice
PracticePractice
Practice
Daman Toor
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
Arockia Abins
 
Mca ii os u-2 process management & communication
Mca  ii  os u-2 process management & communicationMca  ii  os u-2 process management & communication
Mca ii os u-2 process management & communication
Rai University
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
stilliegeorgiana
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
denneymargareta
 

Similar to Consider a system consisting of processes P1- P2- --- - P11- each of w.docx (20)

ch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.pptch05-program-logic-indefinite-loops.ppt
ch05-program-logic-indefinite-loops.ppt
 
OS Process synchronization Unit3 synchronization
OS Process synchronization Unit3  synchronizationOS Process synchronization Unit3  synchronization
OS Process synchronization Unit3 synchronization
 
Bakery algorithm
Bakery algorithmBakery algorithm
Bakery algorithm
 
The java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdfThe java code works, I just need it to display the results as in t.pdf
The java code works, I just need it to display the results as in t.pdf
 
C programming Lab 2
C programming Lab 2C programming Lab 2
C programming Lab 2
 
Python programming Workshop SITTTR - Kalamassery
Python programming Workshop SITTTR - KalamasseryPython programming Workshop SITTTR - Kalamassery
Python programming Workshop SITTTR - Kalamassery
 
Linux Systems Programming: Process CommunCh11 Processes and Signals
Linux Systems Programming: Process CommunCh11 Processes and SignalsLinux Systems Programming: Process CommunCh11 Processes and Signals
Linux Systems Programming: Process CommunCh11 Processes and Signals
 
ALGO.ppt
ALGO.pptALGO.ppt
ALGO.ppt
 
CP4151 ADSA unit1 Advanced Data Structures and Algorithms
CP4151 ADSA unit1 Advanced Data Structures and AlgorithmsCP4151 ADSA unit1 Advanced Data Structures and Algorithms
CP4151 ADSA unit1 Advanced Data Structures and Algorithms
 
CH05.pdf
CH05.pdfCH05.pdf
CH05.pdf
 
Fundamentals of Programming Chapter 3
Fundamentals of Programming Chapter 3Fundamentals of Programming Chapter 3
Fundamentals of Programming Chapter 3
 
Lab-11-C-Problems.pptx
Lab-11-C-Problems.pptxLab-11-C-Problems.pptx
Lab-11-C-Problems.pptx
 
Process Synchronization
Process SynchronizationProcess Synchronization
Process Synchronization
 
Chapter 6 - Process Synchronization
Chapter 6 - Process SynchronizationChapter 6 - Process Synchronization
Chapter 6 - Process Synchronization
 
System Calls - Introduction
System Calls - IntroductionSystem Calls - Introduction
System Calls - Introduction
 
Practice
PracticePractice
Practice
 
Loops in Python
Loops in PythonLoops in Python
Loops in Python
 
Mca ii os u-2 process management & communication
Mca  ii  os u-2 process management & communicationMca  ii  os u-2 process management & communication
Mca ii os u-2 process management & communication
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 
Programming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docxProgramming Assignment #2CSci 430 Spring 2019Dates.docx
Programming Assignment #2CSci 430 Spring 2019Dates.docx
 

More from ljohn878

A field F is called a prime field if it has no proper subfields- If E.docx
A field F is called a prime field if it has no proper subfields- If E.docxA field F is called a prime field if it has no proper subfields- If E.docx
A field F is called a prime field if it has no proper subfields- If E.docx
ljohn878
 
A heterogeneous top management team A- Relies on the similar nat.docx
A heterogeneous top management team       A- Relies on the similar nat.docxA heterogeneous top management team       A- Relies on the similar nat.docx
A heterogeneous top management team A- Relies on the similar nat.docx
ljohn878
 
A grand tour of four cities begins at CityAand makes successive stops.docx
A grand tour of four cities begins at CityAand makes successive stops.docxA grand tour of four cities begins at CityAand makes successive stops.docx
A grand tour of four cities begins at CityAand makes successive stops.docx
ljohn878
 
A function is given- Determine the average rate of change of the funct.docx
A function is given- Determine the average rate of change of the funct.docxA function is given- Determine the average rate of change of the funct.docx
A function is given- Determine the average rate of change of the funct.docx
ljohn878
 
A description about the tool used to perform the scan A list of identi.docx
A description about the tool used to perform the scan A list of identi.docxA description about the tool used to perform the scan A list of identi.docx
A description about the tool used to perform the scan A list of identi.docx
ljohn878
 
A CPA firm has audited the financial statements included in a Form S-1.docx
A CPA firm has audited the financial statements included in a Form S-1.docxA CPA firm has audited the financial statements included in a Form S-1.docx
A CPA firm has audited the financial statements included in a Form S-1.docx
ljohn878
 
A contemporary issue facing technology innovation today is the tension.docx
A contemporary issue facing technology innovation today is the tension.docxA contemporary issue facing technology innovation today is the tension.docx
A contemporary issue facing technology innovation today is the tension.docx
ljohn878
 
Conduct an External Environmental Scan for your selected company- Iden.docx
Conduct an External Environmental Scan for your selected company- Iden.docxConduct an External Environmental Scan for your selected company- Iden.docx
Conduct an External Environmental Scan for your selected company- Iden.docx
ljohn878
 
Computing an average mark for four tests Design the algorithm and the.docx
Computing an average mark for four tests  Design the algorithm and the.docxComputing an average mark for four tests  Design the algorithm and the.docx
Computing an average mark for four tests Design the algorithm and the.docx
ljohn878
 
Computer Networks- Write either True or False 1- In LTE- a mobile devi.docx
Computer Networks- Write either True or False 1- In LTE- a mobile devi.docxComputer Networks- Write either True or False 1- In LTE- a mobile devi.docx
Computer Networks- Write either True or False 1- In LTE- a mobile devi.docx
ljohn878
 
Computation of weighted average shares outstanding during the year- J.docx
Computation of weighted average shares outstanding during the year-  J.docxComputation of weighted average shares outstanding during the year-  J.docx
Computation of weighted average shares outstanding during the year- J.docx
ljohn878
 
Comprehensive Problem 5 (Part Level Submission) On December 1- 2014- J.docx
Comprehensive Problem 5 (Part Level Submission) On December 1- 2014- J.docxComprehensive Problem 5 (Part Level Submission) On December 1- 2014- J.docx
Comprehensive Problem 5 (Part Level Submission) On December 1- 2014- J.docx
ljohn878
 
Completely classify liquid FeFe- Pure Substance Compound Mixture Eleme.docx
Completely classify liquid FeFe- Pure Substance Compound Mixture Eleme.docxCompletely classify liquid FeFe- Pure Substance Compound Mixture Eleme.docx
Completely classify liquid FeFe- Pure Substance Compound Mixture Eleme.docx
ljohn878
 
Complete the following table by calculating the missing entries and in.docx
Complete the following table by calculating the missing entries and in.docxComplete the following table by calculating the missing entries and in.docx
Complete the following table by calculating the missing entries and in.docx
ljohn878
 
Compare the models and information found with NonakaSolutiondeveloped.docx
Compare the models and information found with NonakaSolutiondeveloped.docxCompare the models and information found with NonakaSolutiondeveloped.docx
Compare the models and information found with NonakaSolutiondeveloped.docx
ljohn878
 
Compare the models and information found with NonakaSolutiondeveloped (2).docx
Compare the models and information found with NonakaSolutiondeveloped (2).docxCompare the models and information found with NonakaSolutiondeveloped (2).docx
Compare the models and information found with NonakaSolutiondeveloped (2).docx
ljohn878
 
Complete the following Java code such that it opens a file named Fruit.docx
Complete the following Java code such that it opens a file named Fruit.docxComplete the following Java code such that it opens a file named Fruit.docx
Complete the following Java code such that it opens a file named Fruit.docx
ljohn878
 
Compare the models and information found with NonakaSolutiondeveloped (1).docx
Compare the models and information found with NonakaSolutiondeveloped (1).docxCompare the models and information found with NonakaSolutiondeveloped (1).docx
Compare the models and information found with NonakaSolutiondeveloped (1).docx
ljohn878
 
Compare the models and information found with NonakaSolutiondeveloped (3).docx
Compare the models and information found with NonakaSolutiondeveloped (3).docxCompare the models and information found with NonakaSolutiondeveloped (3).docx
Compare the models and information found with NonakaSolutiondeveloped (3).docx
ljohn878
 
Compare and contrast the Internal Rate of Return (IRR)- the Net Presen.docx
Compare and contrast the Internal Rate of Return (IRR)- the Net Presen.docxCompare and contrast the Internal Rate of Return (IRR)- the Net Presen.docx
Compare and contrast the Internal Rate of Return (IRR)- the Net Presen.docx
ljohn878
 

More from ljohn878 (20)

A field F is called a prime field if it has no proper subfields- If E.docx
A field F is called a prime field if it has no proper subfields- If E.docxA field F is called a prime field if it has no proper subfields- If E.docx
A field F is called a prime field if it has no proper subfields- If E.docx
 
A heterogeneous top management team A- Relies on the similar nat.docx
A heterogeneous top management team       A- Relies on the similar nat.docxA heterogeneous top management team       A- Relies on the similar nat.docx
A heterogeneous top management team A- Relies on the similar nat.docx
 
A grand tour of four cities begins at CityAand makes successive stops.docx
A grand tour of four cities begins at CityAand makes successive stops.docxA grand tour of four cities begins at CityAand makes successive stops.docx
A grand tour of four cities begins at CityAand makes successive stops.docx
 
A function is given- Determine the average rate of change of the funct.docx
A function is given- Determine the average rate of change of the funct.docxA function is given- Determine the average rate of change of the funct.docx
A function is given- Determine the average rate of change of the funct.docx
 
A description about the tool used to perform the scan A list of identi.docx
A description about the tool used to perform the scan A list of identi.docxA description about the tool used to perform the scan A list of identi.docx
A description about the tool used to perform the scan A list of identi.docx
 
A CPA firm has audited the financial statements included in a Form S-1.docx
A CPA firm has audited the financial statements included in a Form S-1.docxA CPA firm has audited the financial statements included in a Form S-1.docx
A CPA firm has audited the financial statements included in a Form S-1.docx
 
A contemporary issue facing technology innovation today is the tension.docx
A contemporary issue facing technology innovation today is the tension.docxA contemporary issue facing technology innovation today is the tension.docx
A contemporary issue facing technology innovation today is the tension.docx
 
Conduct an External Environmental Scan for your selected company- Iden.docx
Conduct an External Environmental Scan for your selected company- Iden.docxConduct an External Environmental Scan for your selected company- Iden.docx
Conduct an External Environmental Scan for your selected company- Iden.docx
 
Computing an average mark for four tests Design the algorithm and the.docx
Computing an average mark for four tests  Design the algorithm and the.docxComputing an average mark for four tests  Design the algorithm and the.docx
Computing an average mark for four tests Design the algorithm and the.docx
 
Computer Networks- Write either True or False 1- In LTE- a mobile devi.docx
Computer Networks- Write either True or False 1- In LTE- a mobile devi.docxComputer Networks- Write either True or False 1- In LTE- a mobile devi.docx
Computer Networks- Write either True or False 1- In LTE- a mobile devi.docx
 
Computation of weighted average shares outstanding during the year- J.docx
Computation of weighted average shares outstanding during the year-  J.docxComputation of weighted average shares outstanding during the year-  J.docx
Computation of weighted average shares outstanding during the year- J.docx
 
Comprehensive Problem 5 (Part Level Submission) On December 1- 2014- J.docx
Comprehensive Problem 5 (Part Level Submission) On December 1- 2014- J.docxComprehensive Problem 5 (Part Level Submission) On December 1- 2014- J.docx
Comprehensive Problem 5 (Part Level Submission) On December 1- 2014- J.docx
 
Completely classify liquid FeFe- Pure Substance Compound Mixture Eleme.docx
Completely classify liquid FeFe- Pure Substance Compound Mixture Eleme.docxCompletely classify liquid FeFe- Pure Substance Compound Mixture Eleme.docx
Completely classify liquid FeFe- Pure Substance Compound Mixture Eleme.docx
 
Complete the following table by calculating the missing entries and in.docx
Complete the following table by calculating the missing entries and in.docxComplete the following table by calculating the missing entries and in.docx
Complete the following table by calculating the missing entries and in.docx
 
Compare the models and information found with NonakaSolutiondeveloped.docx
Compare the models and information found with NonakaSolutiondeveloped.docxCompare the models and information found with NonakaSolutiondeveloped.docx
Compare the models and information found with NonakaSolutiondeveloped.docx
 
Compare the models and information found with NonakaSolutiondeveloped (2).docx
Compare the models and information found with NonakaSolutiondeveloped (2).docxCompare the models and information found with NonakaSolutiondeveloped (2).docx
Compare the models and information found with NonakaSolutiondeveloped (2).docx
 
Complete the following Java code such that it opens a file named Fruit.docx
Complete the following Java code such that it opens a file named Fruit.docxComplete the following Java code such that it opens a file named Fruit.docx
Complete the following Java code such that it opens a file named Fruit.docx
 
Compare the models and information found with NonakaSolutiondeveloped (1).docx
Compare the models and information found with NonakaSolutiondeveloped (1).docxCompare the models and information found with NonakaSolutiondeveloped (1).docx
Compare the models and information found with NonakaSolutiondeveloped (1).docx
 
Compare the models and information found with NonakaSolutiondeveloped (3).docx
Compare the models and information found with NonakaSolutiondeveloped (3).docxCompare the models and information found with NonakaSolutiondeveloped (3).docx
Compare the models and information found with NonakaSolutiondeveloped (3).docx
 
Compare and contrast the Internal Rate of Return (IRR)- the Net Presen.docx
Compare and contrast the Internal Rate of Return (IRR)- the Net Presen.docxCompare and contrast the Internal Rate of Return (IRR)- the Net Presen.docx
Compare and contrast the Internal Rate of Return (IRR)- the Net Presen.docx
 

Recently uploaded

How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
AyyanKhan40
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Thiyagu K
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
Celine George
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
Bisnar Chase Personal Injury Attorneys
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
Wasim Ak
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Ashish Kohli
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
AG2 Design
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 

Recently uploaded (20)

How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
PIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf IslamabadPIMS Job Advertisement 2024.pdf Islamabad
PIMS Job Advertisement 2024.pdf Islamabad
 
Unit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdfUnit 2- Research Aptitude (UGC NET Paper I).pdf
Unit 2- Research Aptitude (UGC NET Paper I).pdf
 
How to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP ModuleHow to Add Chatter in the odoo 17 ERP Module
How to Add Chatter in the odoo 17 ERP Module
 
Top five deadliest dog breeds in America
Top five deadliest dog breeds in AmericaTop five deadliest dog breeds in America
Top five deadliest dog breeds in America
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
Normal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of LabourNormal Labour/ Stages of Labour/ Mechanism of Labour
Normal Labour/ Stages of Labour/ Mechanism of Labour
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
Aficamten in HCM (SEQUOIA HCM TRIAL 2024)
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
Delivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and TrainingDelivering Micro-Credentials in Technical and Vocational Education and Training
Delivering Micro-Credentials in Technical and Vocational Education and Training
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 

Consider a system consisting of processes P1- P2- --- - P11- each of w.docx

  • 1. Consider a system consisting of processes P1, P2, ... , P11, each of which has a unique priority number. Write a monitor that allocates three identical line printers to these processes, using the priority numbers for deciding the order of allocation. Solution 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. The code for monitor is as follows: 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 ;