SlideShare una empresa de Scribd logo
1 de 24
 
INTRODUCTION A primary aim of an operating system is to share a computer installation among many programs  making unpredictable demands upon its resources. A primary tusk of its designer is therefore to construct resource allocation (or scheduling) algorithms for resources of various kinds (main store, drum store, magnetic tape handlers, consoles, etc.). In order to simplify his task, he should try to construct separate schedulers for each class of resource.  Each scheduler will consist of a certain amount of local administrative data, together with some procedures and functions which are called byprograms wishing to acquire and release resources. Such a collection of associated data and procedures is known as a  monitor; and a suitable notation can be based on the class notalion of
AIM: Monitors were developed in the 1970s to make it easier to avoid deadlocks. WHAT IS MONITOR …….?: >>A monitor is a collection of procedures, variables, and data structures grouped together. >>Processes can call the monitor procedures but cannot access the internal data structures. >>Only one process at a time may be be  active  in a monitor. >>Active in a monitor means in ready queue or CPU with the program counter somewhere in a monitor method. >>A monitor is a language construct. >>Compare this with semaphores, which are usually an OS construct.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],>>The compiler usually enforces mutual exclusion. >>Condition variables allow for blocking and unblocking.
In order to call a procedure of a monitor, it is necessary to give the name of the monitor as well as thename of the desired procedure, separating them by a dot: monitorname.procname(.. actual parameters ...); In an operating system it is sometimes desirable to declare several monitors with identical structureand behavior, for example to schedule two similar resources. In such cases, the declaration shown above. will be preceded by the word  class, and the separate monitors will be declared lo belong to this 1. Introduction monitor 1, monitor 2: classname; Thus the structure of a class of monitors is identical to that described for a data representation in [13],except for addition of the basic word  monitor. Brinch-Hansen uses the word shared for the same  purpose
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dining Philosophers >>Look at code for almost solving this using monitor pseudocode. >>Note that this "solution" allows starvation.
Monitor Implementation >>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.  >>These are the queues that might be used:
The entry queue  contains processes attempting to call a monitor procedure from outside the monitor.Each monitor has one entry queue. The signaller queue  contains processes processes that have executed a notify operation.Each monitor has at most one signaller queue. In some implementations, a notify leaves the process active and no signaller queue is needed. The waiting queue  contains processes that have been awakened by a notify operation.Each monitor has one waiting queue. Condition variable queues   contain processes that have executed a condition variable wait operation.There is one such queue for each condition variable. The relative priorities of these queues determines the operation of the monitor implementation.
The queues associated with a monitor that does not have a signaller queue. The lock becomes available when the active process executes a wait or leaves the monitor.
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Goal of OS:  is to share resources amongst many programs.Separate schedulers should be created for each class of resource.Each scheduler contains local data + procedures that programs may use to acquire and release resources. �   Such a collection of data + procedures is a monitor. � Only one program may enter a procedure of a monitor at a given time.   Hence, only one program may modify local data of the monitor at a given time. �  If more  than  one program attempts to enter at the same time, only one will succeed, and the remaining programs will remain on a queue.  
EXAMPLE As the simplest example of a monitor, we will design a scheduling algorithm for a single resource,which is dynamically acquired and releasecd by an unknown number of customer processes by calls on procedures procedure  acquire; procedure  release; A variable (1) busy: Boolean Determines whether or not the resource is in use. If an attempt is made to acquire the resource when it is busy, the attempting program must be delayed by waiting on a variable nonbusy:condition which is signalled by the next subsequent release. The initial value of busy is false. These design  decisions lead to the following code for the monitor:
: single resource: monitor begin  busy:Boolean; nonbusy:condition; procedure  acquire; begin if  busy then nonbusy.wait; busy := true end; procedure  release; begin  busy := false; nonbusy.signal end; busy := false;  comment inital value; end  single resource;
: NOTES ,[object Object],[object Object],[object Object],[object Object]
Examples:  The paper provides several other examples of using monitors and condition variables to solve common synchronization problems to prove their utility. � Some of these problems are buffer allocation, disk head scheduling, and  multiple readers/writers to a file.   Note of interest: �  Every class in Java defines a monitor. �  A synchronized method in a class becomes a monitor procedure . �  Every object is allocated its own mutex, and that mutex is locked whenever a thread enters a synchronized method. �  The class as a whole is also allocated its own mutex, and that mutex is locked whenever a static synchronized method is called. �  Every Java object also has a condition variable associated with it.
�  When wait() or signal() are called in a method, the wait or signal takes place on the condition variable associated with the object. �  Wait() and signal() calls can only be made in synchronized methods. � The wait() method in the class Object is overloaded, and has a version that takes an integer, but this is different than the priority wait extension that Hoare suggests. �  In addition, I do not believe that the Java scheduler guarantees that when signal is called a thread that had previously called wait immediately runs, but I could be wrong about this.
What problems do monitors solve? ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
What remains problematic? >>No way to check dynamically allocated shared data >>Signals are as error prone as with other synchronization mechanisms >>Deadlock can still happen in monitor code >>Programmer can still screw up >>Monitors are available in very few languages
What remains problematic? >>No way to check dynamically allocated shared data >>Signals are as error prone as with other synchronization mechanisms >>Deadlock can still happen in monitor code >>Programmer can still screw up >>Monitors are available in very few languages
Volatile memory  : Volatile memory  also known as  volatile storage , is  computer memory  that requires power to maintain the stored information, unlike  non-volatile memory  which does not require a maintained power supply. It has been less popularly known as  temporary memory . Non-volatile memory nonvolatile memory ,  NVM  or  non-volatile storage , in the most basic sense, is  computer memory  that can retain the stored information even when not powered. Examples of non-volatile memory include  read-only memory ,  flash memory , most types of magnetic  computer storage  devices (e.g.  hard disks ,  floppy disks , and  magnetic tape ),  optical discs , and early computer storage methods such as  paper tape  and  punched cards . Non-volatile memory is typically used for the task of  secondary storage , or long-term persistent storage. The most widely used form of  primary storage  today is a volatile form of  random access memory  (RAM), meaning that when the computer is shut down, anything contained in RAM is lost. Unfortunately, most forms of non-volatile memory have limitations that make them unsuitable for use as primary storage. Typically, non-volatile memory either costs more or performs worse than volatile random access memory.
Stable storage  : is a classification of computer  data storage  technology that guarantees  atomicity [ disambiguation needed ]  for any given write operation and allows software to be written that is  robust  against some hardware and power failures. To be considered atomic, upon reading back a just written-to portion of the disk, the storage subsystem must return either the write data or the data that was on that portion of the disk before the write operation. Most computer  disk drives  are not considered stable storage because they do not guarantee atomic write: an error could be returned upon subsequent read of the disk where it was just written to in lieu of either the new or prior data.
Conclusions Monitors are a synchronization mechanism A higher level, easier to use abstraction, better encapsulation than semaphores, etc. Monitors still suffer from various problems Let’s take a look at working model that addresses some of those issues!  (Suzanne’s presentation)
THANK YOU

Más contenido relacionado

La actualidad más candente

Ch7 OS
Ch7 OSCh7 OS
Ch7 OSC.U
 
Lec11 semaphores
Lec11 semaphoresLec11 semaphores
Lec11 semaphoresanandammca
 
Qtp92 Presentation
Qtp92 PresentationQtp92 Presentation
Qtp92 Presentationa34sharm
 
05 junit
05 junit05 junit
05 junitmha4
 
Unit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran JanardhanaUnit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran JanardhanaRavikiran J
 
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't Suck
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't SuckDeliver Faster with BDD/TDD - Designing Automated Tests That Don't Suck
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't SuckKevin Brockhoff
 
Quick test professional certifcation questions and tutorial2
Quick test professional certifcation questions and tutorial2Quick test professional certifcation questions and tutorial2
Quick test professional certifcation questions and tutorial2Ramu Palanki
 
Tortuga-A simulation software
Tortuga-A simulation softwareTortuga-A simulation software
Tortuga-A simulation softwareSyeda Nyma
 

La actualidad más candente (20)

Unit iv: Deadlocks
Unit iv: DeadlocksUnit iv: Deadlocks
Unit iv: Deadlocks
 
Junit
JunitJunit
Junit
 
SYNCHRONIZATION
SYNCHRONIZATIONSYNCHRONIZATION
SYNCHRONIZATION
 
Ch7 OS
Ch7 OSCh7 OS
Ch7 OS
 
Semaphores
SemaphoresSemaphores
Semaphores
 
Lec11 semaphores
Lec11 semaphoresLec11 semaphores
Lec11 semaphores
 
Java Unit Testing
Java Unit TestingJava Unit Testing
Java Unit Testing
 
Qtp92 Presentation
Qtp92 PresentationQtp92 Presentation
Qtp92 Presentation
 
Operating system critical section
Operating system   critical sectionOperating system   critical section
Operating system critical section
 
05 junit
05 junit05 junit
05 junit
 
Unit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran JanardhanaUnit Testing with JUnit4 by Ravikiran Janardhana
Unit Testing with JUnit4 by Ravikiran Janardhana
 
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't Suck
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't SuckDeliver Faster with BDD/TDD - Designing Automated Tests That Don't Suck
Deliver Faster with BDD/TDD - Designing Automated Tests That Don't Suck
 
Ch 6 randomization
Ch 6 randomizationCh 6 randomization
Ch 6 randomization
 
Testing with Junit4
Testing with Junit4Testing with Junit4
Testing with Junit4
 
JUnit 4
JUnit 4JUnit 4
JUnit 4
 
Critical section operating system
Critical section  operating systemCritical section  operating system
Critical section operating system
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Quick test professional certifcation questions and tutorial2
Quick test professional certifcation questions and tutorial2Quick test professional certifcation questions and tutorial2
Quick test professional certifcation questions and tutorial2
 
Trabajo
TrabajoTrabajo
Trabajo
 
Tortuga-A simulation software
Tortuga-A simulation softwareTortuga-A simulation software
Tortuga-A simulation software
 

Destacado

Group presentation significant women
Group presentation significant womenGroup presentation significant women
Group presentation significant womenginamontanez
 
Women's day celebration at the resort
Women's day celebration at the resortWomen's day celebration at the resort
Women's day celebration at the resortTheResort MadhMarve
 
International Women’s Day
International Women’s DayInternational Women’s Day
International Women’s DayMaribel Alvarez
 
International Women’S Day
International Women’S DayInternational Women’S Day
International Women’S Daymfresnillo
 

Destacado (6)

Ms access
Ms accessMs access
Ms access
 
Group presentation significant women
Group presentation significant womenGroup presentation significant women
Group presentation significant women
 
Women's day celebration at the resort
Women's day celebration at the resortWomen's day celebration at the resort
Women's day celebration at the resort
 
Women's day ppt
Women's day pptWomen's day ppt
Women's day ppt
 
International Women’s Day
International Women’s DayInternational Women’s Day
International Women’s Day
 
International Women’S Day
International Women’S DayInternational Women’S Day
International Women’S Day
 

Similar a Monitor(karthika)

Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Ra'Fat Al-Msie'deen
 
Dependable Software Development in Software Engineering SE18
Dependable Software Development in Software Engineering SE18Dependable Software Development in Software Engineering SE18
Dependable Software Development in Software Engineering SE18koolkampus
 
Os files 2
Os files 2Os files 2
Os files 2Amit Pal
 
Runtime performance evaluation of embedded software
Runtime performance evaluation of embedded softwareRuntime performance evaluation of embedded software
Runtime performance evaluation of embedded softwareMr. Chanuwan
 
Runtimeperformanceevaluationofembeddedsoftware 100825224539-phpapp02
Runtimeperformanceevaluationofembeddedsoftware 100825224539-phpapp02Runtimeperformanceevaluationofembeddedsoftware 100825224539-phpapp02
Runtimeperformanceevaluationofembeddedsoftware 100825224539-phpapp02NNfamily
 
Operating system
Operating systemOperating system
Operating systemMark Muhama
 
Processscheduling 161001112521
Processscheduling 161001112521Processscheduling 161001112521
Processscheduling 161001112521marangburu42
 
Processscheduling 161001112521
Processscheduling 161001112521Processscheduling 161001112521
Processscheduling 161001112521marangburu42
 
Processscheduling 161001112521
Processscheduling 161001112521Processscheduling 161001112521
Processscheduling 161001112521marangburu42
 
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...vtunotesbysree
 
Operating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - EngineeringOperating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - EngineeringYogesh Santhan
 
Operating System
Operating SystemOperating System
Operating Systemguest8b0942
 
Operating system Interview Questions
Operating system Interview QuestionsOperating system Interview Questions
Operating system Interview QuestionsKuntal Bhowmick
 
Operating system Q/A
Operating system Q/AOperating system Q/A
Operating system Q/AAbdul Munam
 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02Gopi Raghavendra
 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)QA Programmer
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationMani Deepak Choudhry
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaSridhar Kumar N
 

Similar a Monitor(karthika) (20)

Processing management
Processing managementProcessing management
Processing management
 
Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"Operating Systems - "Chapter 5 Process Synchronization"
Operating Systems - "Chapter 5 Process Synchronization"
 
Dependable Software Development in Software Engineering SE18
Dependable Software Development in Software Engineering SE18Dependable Software Development in Software Engineering SE18
Dependable Software Development in Software Engineering SE18
 
Os files 2
Os files 2Os files 2
Os files 2
 
Runtime performance evaluation of embedded software
Runtime performance evaluation of embedded softwareRuntime performance evaluation of embedded software
Runtime performance evaluation of embedded software
 
Runtimeperformanceevaluationofembeddedsoftware 100825224539-phpapp02
Runtimeperformanceevaluationofembeddedsoftware 100825224539-phpapp02Runtimeperformanceevaluationofembeddedsoftware 100825224539-phpapp02
Runtimeperformanceevaluationofembeddedsoftware 100825224539-phpapp02
 
Operating system
Operating systemOperating system
Operating system
 
Processscheduling 161001112521
Processscheduling 161001112521Processscheduling 161001112521
Processscheduling 161001112521
 
Chapter 3.pdf
Chapter 3.pdfChapter 3.pdf
Chapter 3.pdf
 
Processscheduling 161001112521
Processscheduling 161001112521Processscheduling 161001112521
Processscheduling 161001112521
 
Processscheduling 161001112521
Processscheduling 161001112521Processscheduling 161001112521
Processscheduling 161001112521
 
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
SOLUTION MANUAL OF OPERATING SYSTEM CONCEPTS BY ABRAHAM SILBERSCHATZ, PETER B...
 
Operating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - EngineeringOperating Systems Unit Two - Fourth Semester - Engineering
Operating Systems Unit Two - Fourth Semester - Engineering
 
Operating System
Operating SystemOperating System
Operating System
 
Operating system Interview Questions
Operating system Interview QuestionsOperating system Interview Questions
Operating system Interview Questions
 
Operating system Q/A
Operating system Q/AOperating system Q/A
Operating system Q/A
 
performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02performancetestingjmeter-121109061704-phpapp02
performancetestingjmeter-121109061704-phpapp02
 
performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)performancetestingjmeter-121109061704-phpapp02 (1)
performancetestingjmeter-121109061704-phpapp02 (1)
 
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncationLM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
LM9 - OPERATIONS, SCHEDULING, Inter process xommuncation
 
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,GrafanaPrometheus - Intro, CNCF, TSDB,PromQL,Grafana
Prometheus - Intro, CNCF, TSDB,PromQL,Grafana
 

Más de Nagarajan

Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Nagarajan
 
Real time os(suga)
Real time os(suga) Real time os(suga)
Real time os(suga) Nagarajan
 
Process synchronization(deepa)
Process synchronization(deepa)Process synchronization(deepa)
Process synchronization(deepa)Nagarajan
 
Posix threads(asha)
Posix threads(asha)Posix threads(asha)
Posix threads(asha)Nagarajan
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)Nagarajan
 
Backward chaining(bala,karthi,rajesh)
Backward chaining(bala,karthi,rajesh)Backward chaining(bala,karthi,rajesh)
Backward chaining(bala,karthi,rajesh)Nagarajan
 
Introduction Of Artificial neural network
Introduction Of Artificial neural networkIntroduction Of Artificial neural network
Introduction Of Artificial neural networkNagarajan
 
Back propagation
Back propagationBack propagation
Back propagationNagarajan
 
Adaline madaline
Adaline madalineAdaline madaline
Adaline madalineNagarajan
 

Más de Nagarajan (17)

Chapter3
Chapter3Chapter3
Chapter3
 
Chapter2
Chapter2Chapter2
Chapter2
 
Chapter1
Chapter1Chapter1
Chapter1
 
Minimax
MinimaxMinimax
Minimax
 
I/O System
I/O SystemI/O System
I/O System
 
Scheduling algorithm (chammu)
Scheduling algorithm (chammu)Scheduling algorithm (chammu)
Scheduling algorithm (chammu)
 
Real time os(suga)
Real time os(suga) Real time os(suga)
Real time os(suga)
 
Process synchronization(deepa)
Process synchronization(deepa)Process synchronization(deepa)
Process synchronization(deepa)
 
Posix threads(asha)
Posix threads(asha)Posix threads(asha)
Posix threads(asha)
 
Cpu scheduling(suresh)
Cpu scheduling(suresh)Cpu scheduling(suresh)
Cpu scheduling(suresh)
 
Backward chaining(bala,karthi,rajesh)
Backward chaining(bala,karthi,rajesh)Backward chaining(bala,karthi,rajesh)
Backward chaining(bala,karthi,rajesh)
 
Inferno
InfernoInferno
Inferno
 
Javascript
JavascriptJavascript
Javascript
 
Introduction Of Artificial neural network
Introduction Of Artificial neural networkIntroduction Of Artificial neural network
Introduction Of Artificial neural network
 
Perceptron
PerceptronPerceptron
Perceptron
 
Back propagation
Back propagationBack propagation
Back propagation
 
Adaline madaline
Adaline madalineAdaline madaline
Adaline madaline
 

Último

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docxPoojaSen20
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701bronxfugly43
 

Último (20)

Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701ComPTIA Overview | Comptia Security+ Book SY0-701
ComPTIA Overview | Comptia Security+ Book SY0-701
 

Monitor(karthika)

  • 1.  
  • 2. INTRODUCTION A primary aim of an operating system is to share a computer installation among many programs making unpredictable demands upon its resources. A primary tusk of its designer is therefore to construct resource allocation (or scheduling) algorithms for resources of various kinds (main store, drum store, magnetic tape handlers, consoles, etc.). In order to simplify his task, he should try to construct separate schedulers for each class of resource. Each scheduler will consist of a certain amount of local administrative data, together with some procedures and functions which are called byprograms wishing to acquire and release resources. Such a collection of associated data and procedures is known as a monitor; and a suitable notation can be based on the class notalion of
  • 3. AIM: Monitors were developed in the 1970s to make it easier to avoid deadlocks. WHAT IS MONITOR …….?: >>A monitor is a collection of procedures, variables, and data structures grouped together. >>Processes can call the monitor procedures but cannot access the internal data structures. >>Only one process at a time may be be  active  in a monitor. >>Active in a monitor means in ready queue or CPU with the program counter somewhere in a monitor method. >>A monitor is a language construct. >>Compare this with semaphores, which are usually an OS construct.
  • 4.
  • 5. In order to call a procedure of a monitor, it is necessary to give the name of the monitor as well as thename of the desired procedure, separating them by a dot: monitorname.procname(.. actual parameters ...); In an operating system it is sometimes desirable to declare several monitors with identical structureand behavior, for example to schedule two similar resources. In such cases, the declaration shown above. will be preceded by the word class, and the separate monitors will be declared lo belong to this 1. Introduction monitor 1, monitor 2: classname; Thus the structure of a class of monitors is identical to that described for a data representation in [13],except for addition of the basic word monitor. Brinch-Hansen uses the word shared for the same purpose
  • 6.
  • 7. Dining Philosophers >>Look at code for almost solving this using monitor pseudocode. >>Note that this "solution" allows starvation.
  • 8. Monitor Implementation >>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.  >>These are the queues that might be used:
  • 9. The entry queue  contains processes attempting to call a monitor procedure from outside the monitor.Each monitor has one entry queue. The signaller queue  contains processes processes that have executed a notify operation.Each monitor has at most one signaller queue. In some implementations, a notify leaves the process active and no signaller queue is needed. The waiting queue  contains processes that have been awakened by a notify operation.Each monitor has one waiting queue. Condition variable queues   contain processes that have executed a condition variable wait operation.There is one such queue for each condition variable. The relative priorities of these queues determines the operation of the monitor implementation.
  • 10. The queues associated with a monitor that does not have a signaller queue. The lock becomes available when the active process executes a wait or leaves the monitor.
  • 11.
  • 12. Goal of OS: is to share resources amongst many programs.Separate schedulers should be created for each class of resource.Each scheduler contains local data + procedures that programs may use to acquire and release resources. �   Such a collection of data + procedures is a monitor. � Only one program may enter a procedure of a monitor at a given time.   Hence, only one program may modify local data of the monitor at a given time. �  If more than one program attempts to enter at the same time, only one will succeed, and the remaining programs will remain on a queue.  
  • 13. EXAMPLE As the simplest example of a monitor, we will design a scheduling algorithm for a single resource,which is dynamically acquired and releasecd by an unknown number of customer processes by calls on procedures procedure acquire; procedure release; A variable (1) busy: Boolean Determines whether or not the resource is in use. If an attempt is made to acquire the resource when it is busy, the attempting program must be delayed by waiting on a variable nonbusy:condition which is signalled by the next subsequent release. The initial value of busy is false. These design decisions lead to the following code for the monitor:
  • 14. : single resource: monitor begin busy:Boolean; nonbusy:condition; procedure acquire; begin if busy then nonbusy.wait; busy := true end; procedure release; begin busy := false; nonbusy.signal end; busy := false; comment inital value; end single resource;
  • 15.
  • 16. Examples: The paper provides several other examples of using monitors and condition variables to solve common synchronization problems to prove their utility. � Some of these problems are buffer allocation, disk head scheduling, and multiple readers/writers to a file.   Note of interest: �  Every class in Java defines a monitor. �  A synchronized method in a class becomes a monitor procedure . �  Every object is allocated its own mutex, and that mutex is locked whenever a thread enters a synchronized method. �  The class as a whole is also allocated its own mutex, and that mutex is locked whenever a static synchronized method is called. �  Every Java object also has a condition variable associated with it.
  • 17. �  When wait() or signal() are called in a method, the wait or signal takes place on the condition variable associated with the object. �  Wait() and signal() calls can only be made in synchronized methods. � The wait() method in the class Object is overloaded, and has a version that takes an integer, but this is different than the priority wait extension that Hoare suggests. �  In addition, I do not believe that the Java scheduler guarantees that when signal is called a thread that had previously called wait immediately runs, but I could be wrong about this.
  • 18.
  • 19. What remains problematic? >>No way to check dynamically allocated shared data >>Signals are as error prone as with other synchronization mechanisms >>Deadlock can still happen in monitor code >>Programmer can still screw up >>Monitors are available in very few languages
  • 20. What remains problematic? >>No way to check dynamically allocated shared data >>Signals are as error prone as with other synchronization mechanisms >>Deadlock can still happen in monitor code >>Programmer can still screw up >>Monitors are available in very few languages
  • 21. Volatile memory : Volatile memory also known as volatile storage , is computer memory that requires power to maintain the stored information, unlike non-volatile memory which does not require a maintained power supply. It has been less popularly known as temporary memory . Non-volatile memory nonvolatile memory , NVM or non-volatile storage , in the most basic sense, is computer memory that can retain the stored information even when not powered. Examples of non-volatile memory include read-only memory , flash memory , most types of magnetic computer storage devices (e.g. hard disks , floppy disks , and magnetic tape ), optical discs , and early computer storage methods such as paper tape and punched cards . Non-volatile memory is typically used for the task of secondary storage , or long-term persistent storage. The most widely used form of primary storage today is a volatile form of random access memory (RAM), meaning that when the computer is shut down, anything contained in RAM is lost. Unfortunately, most forms of non-volatile memory have limitations that make them unsuitable for use as primary storage. Typically, non-volatile memory either costs more or performs worse than volatile random access memory.
  • 22. Stable storage : is a classification of computer data storage technology that guarantees atomicity [ disambiguation needed ] for any given write operation and allows software to be written that is robust against some hardware and power failures. To be considered atomic, upon reading back a just written-to portion of the disk, the storage subsystem must return either the write data or the data that was on that portion of the disk before the write operation. Most computer disk drives are not considered stable storage because they do not guarantee atomic write: an error could be returned upon subsequent read of the disk where it was just written to in lieu of either the new or prior data.
  • 23. Conclusions Monitors are a synchronization mechanism A higher level, easier to use abstraction, better encapsulation than semaphores, etc. Monitors still suffer from various problems Let’s take a look at working model that addresses some of those issues! (Suzanne’s presentation)