SlideShare une entreprise Scribd logo
1  sur  71
Damian Gordon
 If you were assembling some IKEA furniture,
and following the step-by-step guide of 20
steps.
 Imagine you did step 1, then step 2, then
step 3, suddenly the doorbell rang, and you
are interrupted.
 You would stop what you are doing and deal
with whoever is at the door.
 Then you would return to the assembly,
check what step you were on, and then
continue on from there (step 4).
 This is how the computer runs multiple
processes simultaneously … you do a few
steps on one process, get interrupted, work
on other processes, then return to the first
process, remembering where you left off
from, and continue on.
 This swapping of processes is called a pre-
emptive scheduling policy.
 A “Process” is the basic unit of execution in
the operating system
 A “Process” is the name we give to a program
when it is running in memory
◦ So a “Program” is the complied executable
◦ And a “Process” is the running executable with the
execution state.
 The same program being run by two different
users in the operating system are two
different processes
User 1
Process
1
Running
Executable 1
Execution
State 1
User 2
Process
2
Execution
State 2
Running
Executable 1
 The Processor Manager is made up of two
sub-managers:
Process Scheduler
Job Scheduler
Process Scheduler
Job Scheduler
Process
2
Process
3
Process
4
Process
5
Process
1
 We describe a collection of processes as a
“job”.
 When the operating systems is presented with
a queue of jobs or processes to run, the Job
Scheduler has the task of deciding which
order to run the are jobs in.
 The Job Scheduler wants to ensure that the all
components of the operating system are
busy, and there is no component that is idle.
 Let’s think about this program:
PROGRAM PrintValue:
BEGIN
Input A;
Input B;
C = A + B;
D = A – B;
Print “The sum of inputs is: “, C;
Print “The Difference of inputs is: “, D;
END.
I/O
 Let’s think about this program:
PROGRAM PrintValue:
BEGIN
Input A;
Input B;
C = A + B;
D = A – B;
Print “The sum of inputs is: “, C;
Print “The Difference of inputs is: “, D;
END.
I/O
 Let’s think about this program:
PROGRAM PrintValue:
BEGIN
Input A;
Input B;
C = A + B;
D = A – B;
Print “The sum of inputs is: “, C;
Print “The Difference of inputs is: “, D;
END.
Reading
from
keyboard
I/O
I/O
 Let’s think about this program:
PROGRAM PrintValue:
BEGIN
Input A;
Input B;
C = A + B;
D = A – B;
Print “The sum of inputs is: “, C;
Print “The Difference of inputs is: “, D;
END.
I/O
I/O
 Let’s think about this program:
PROGRAM PrintValue:
BEGIN
Input A;
Input B;
C = A + B;
D = A – B;
Print “The sum of inputs is: “, C;
Print “The Difference of inputs is: “, D;
END.
Writing
To
screen
CPU
I/O
I/O
 Let’s think about this program:
PROGRAM PrintValue:
BEGIN
Input A;
Input B;
C = A + B;
D = A – B;
Print “The sum of inputs is: “, C;
Print “The Difference of inputs is: “, D;
END.
CPU
I/O
I/O
 Let’s think about this program:
PROGRAM PrintValue:
BEGIN
Input A;
Input B;
C = A + B;
D = A – B;
Print “The sum of inputs is: “, C;
Print “The Difference of inputs is: “, D;
END.
Doing
computation
CPU
I/O
I/O
 Some programs do a lot of I/O, e.g. Graphics
programs:
 Others do a lot of computation, but little I/O,
e.g. maths programs:
CPU
I/O
I/O
 If the job scheduler gets jobs like this:
 If the job scheduler gets jobs like this:
 So the job scheduler will take these jobs:
 And swap them around, and pass them onto
the Process Scheduler
 So in this case the Job Scheduler wants to
balance the jobs coming in, so that the
components of the operating system are all
kept busy.
 If we don’t change the order of job, the CPU
will be very busy, but the I/O component will
be idle, and then vice versa.
 This is not an optimal use of resources, so we
swap them around.
 We'll call jobs that are CPU-bound Batch Jobs,
and we’ll call jobs that have a lot of I/O
operations Interactive Jobs.
 This is the first level of swapping of
processes that will occur, and more will be
done by the Process Scheduler. The Job
Scheduler is looking at jobs (or groups of
processes), and looking at the whole process
from a high-level.
 For obvious reasons, the Job Scheduler is also
called the High-Level Scheduler.
 Every process has a field that records their
current status, called the Process Status.
 When the process is first passed to the Job
Scheduler from the operating system, its
status is always set as HOLD.
 When the Job Scheduler passes the process
onto the Process Scheduler, its status is
always changed to READY.
Process
2
Process
3
Process
4
Process
5
Process
1
Process Scheduler
Job SchedulerHOLD
READY
 Other statuses that a process can have are:
Process Scheduler
Job SchedulerHOLD
WAITING
READY
RUNNING
FINISHED
HOLD FINISHED
READY RUNNING
WAITING
Scheduler
Dispatch
Interrupt
Admitted Exit
I/O or
Event wait
I/O or
Event completion
HOLD
READY
WAITING
RUNNING
FINISHED
 Think about traffic lights:
 This is the sequence:
 As mentioned previously the process is first
passed to the Job Scheduler from the
operating system, its status is always set as
HOLD. When the Job Scheduler passes the
process onto the Process Scheduler, its status
is always changed to READY.
 When the CPU is available, the Process
Scheduler will look at all of the upcoming
processes and will select one of them (based
on a predefined algorithm) and assuming
there is memory free, the process will start
running and its status is changed to RUNNING
by the Process Scheduler.
 After a predefined time, the process will be
interrupted, and another process will take
over the CPU, and the interrupted process will
have its status changed to READY by the
Process Scheduler. We will remember that this
swapping of processes is called a pre-
emptive scheduling policy.
 When is CPU is available for this process
again the process status be changed to
RUNNING by the Process Scheduler.
 If the process has to wait for some I/O from
the user or some other event, it is put in a
status of WAITING by the Process Scheduler.
 When the I/O device lets the Process
Scheduler know that the I/O is completed, the
process status will be changed to READY by
the Process Scheduler.
 Finally the process status will be changed to
FINISHED either when the process has
successful completed, or if an error occurs
and the process has to terminate
prematurely. The status change is usually
handled by the Process Scheduler informing
the Job Scheduler of the process completion,
and the Job Scheduler of changing the status.
PROCESS SCHEDULER
JOB SCHEDULER
HOLD
READY
WAITING
RUNNING
FINISHED
 The Process status is only one of a collection
of descriptors that are associated with a
process.
 Each process has a data structure called a
Process Control Block (PCB) associated with it,
rather like a passport.
Operating System
Process Control Block
(PCB)
Process ID
Process Status
Process State
• Program Counter
• Register Contents
• Main Memory
• Resources
• Process Priority
Accounting
 PROCESS IDENTIFIER
◦ Each process is uniquely identified by both the
user’s identification, and a pointer connecting it to
its descriptor.
 PROCESS STATUS
◦ The current status of the process, it is either:
HOLD
READY
WAITING
RUNNING FINISHED
 PROCESS STATE
◦ Program counter
◦ Record the current value of the program counter
0708
 PROCESS STATE
◦ Register Contents
◦ Record the values of the data registers
9 10 11
12 13 14
15
16
18
19
1 2
3 4 5
6 7 8
0
17
20
 PROCESS STATE
◦ Main Memory
◦ Record all
important
information from
memory, including
most importantly
the process
location.
 PROCESS STATE
◦ Resources
◦ Record the resources that have been allocated to
this job, including files, disk drives, and printers.
ID TYPE DETAILS
1 FILE TXT file starting at memory address 0x456
2 FILE DAT file starting at memory address 0x087
3 DISK Disk Drive 4
4 FILE TXT file starting at memory address 0x673
5 PRINTER Printer at IP address 172.242.34.65
 PROCESS STATE
◦ Process Priority
◦ The process is assigned a priority, and if the
operating system using priorities to schedule
processes.
 PROCESS STATE
◦ Process Priority
◦ The process is assigned a priority, and if the
operating system using priorities to schedule
processes.
12 54 66 23 13 32
 PROCESS STATE
◦ Process Priority
◦ The process is assigned a priority, and if the
operating system using priorities to schedule
processes.
12 54 66 23 13 32
1 1 5 2 1 1
 ACCOUNTING
◦ This section records some of the performance
statistics associated with this process, including:
 CPU time used so far
 Time process has been in the system
 Time taken in memory (Main and secondary)
 Space taken in memory (Main and secondary)
 System programs used, compliers, editors, etc.
 Number and type of I/O operations
 Time spent waiting for I/O operations completion
 Number of Input records read and Output records
written
Process ID
Process Status
Process State
• Program Counter
• Register Contents
• Main Memory
• Resources
• Process Priority
Accounting
457
“WAITING”
Process State
• 245
• R1:23, R2:63, R3:71
• Process Address: 345
• File1, File5, Disk4
• 5
CPU: 3, Total Time:34…..
Process ID
Process Status
Process State
• Program Counter
• Register Contents
• Main Memory
• Resources
• Process Priority
Accounting
 What are good policies to schedule
processes?
 MAXIMUM THROUGHPUT
 Get as many jobs done as quickly as possible.
 There are several ways to achieve this, e.g.
run only short jobs, run jobs without
interruptions.
 MINIMIZE RESPONSE TIME
 Ensure that interactive requests are dealt with
as quickly as possible.
 This could be achieved by scheduling just
with a lot of I/O jobs first, and leave the
computational jobs for later.
 MINIMIZE TURNAROUND TIME
 Ensure that jobs are completed as quickly as
possible.
 This could be achieved by scheduling just
with a lot of computation jobs first, and leave
the I/O jobs for later, so there is no user
delays.
 MINIMIZE WAITING TIME
 Move jobs out of the READY status as soon as
possible.
 This could be achieved by reduce the number
of users allowed on the system, so that the
CPU would be available whenever a job enters
the READY status.
 MINIMIZE WAITING TIME
 Move jobs out of the READY status as soon as
possible.
 This could be achieved by reduce the number
of users allowed on the system, so that the
CPU would be available whenever a job enters
the READY status.
 MAXIMISE CPU EFFICIENCY
 Keep the CPU busy 100% of the time.
 This could be achieved by scheduling just
with a lot of computation jobs, and never run
the I/O jobs.
 ENSURE FAIRNESS FOR ALL JOBS
 Give everyone an equal amount of CPU time
and I/O time.
 This could be achieved by giving all jobs
equal priority, regardless of it’s
characteristics.
 Here are six commonly used process
scheduling algorithms
 First Come, First Served (FCFS)
 A very simple algorithm that uses a FIFO
structure.
 Implemented as a non-pre-emptive
scheduling algorithm.
 Works well for Batch Processes, where users
don’t expect any interaction.
 Shortest Job Next (SJN)
 Also called Shortest Job First (SJF).
 A very simple algorithm that schedules
processes based on CPU cycle time.
 Implemented as a non-pre-emptive
scheduling algorithm.
 Works well for Batch Processes, where it is
easy to estimate CPU time.
 Priority Scheduling
 An algorithm that schedules processes based
on priority.
 Implemented as a non-pre-emptive
scheduling algorithm.
 One of the most common algorithms used in
systems that are mainly Batch Processes.
 If two jobs come in of equal priority are
READY, if works on a FIRST COME, FIRST
SERVED basis.
 Shortest Remaining Time (SRT)
 A pre-emptive scheduling version of the
Shortest Job Next (SJN) algorithm.
 An algorithm that schedules processes based
on the one which is nearest to completion.
 It can only be implemented on systems that
are only Batch Processes, since you have to
know the CPU time required to complete each
job.
 Round Robin
 A pre-emptive scheduling algorithm that is
used extensively in interactive systems
 All active processes are given a pre-
determined slice of time (“time quantum”).
 Choosing the time quantum is the key
decision, for interactive systems the quantum
must be small, whereas for batch systems it
can be longer.
 Multi-Level Queues
 This isn’t really a separate scheduling
algorithm, it can be used with others.
 Jobs are grouped together based on common
characteristics.
 For example, CPU-bound jobs based in one
queue, and the I/O-bound jobs in another
queue, and the process scheduler can select
jobs from each queue based on balancing the
load.

Contenu connexe

Tendances (20)

Monitors
MonitorsMonitors
Monitors
 
CPU Scheduling in OS Presentation
CPU Scheduling in OS  PresentationCPU Scheduling in OS  Presentation
CPU Scheduling in OS Presentation
 
Process synchronization in Operating Systems
Process synchronization in Operating SystemsProcess synchronization in Operating Systems
Process synchronization in Operating Systems
 
Process state in OS
Process state in OSProcess state in OS
Process state in OS
 
OS - Process Concepts
OS - Process ConceptsOS - Process Concepts
OS - Process Concepts
 
Cs8493 unit 2
Cs8493 unit 2Cs8493 unit 2
Cs8493 unit 2
 
Operating system architecture
Operating system architectureOperating system architecture
Operating system architecture
 
Fundamentals of operating system
Fundamentals of operating systemFundamentals of operating system
Fundamentals of operating system
 
Process synchronization in operating system
Process synchronization in operating systemProcess synchronization in operating system
Process synchronization in operating system
 
Processes and threads
Processes and threadsProcesses and threads
Processes and threads
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Os unit 3 , process management
Os unit 3 , process managementOs unit 3 , process management
Os unit 3 , process management
 
Process management in linux
Process management in linuxProcess management in linux
Process management in linux
 
First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)First-Come-First-Serve (FCFS)
First-Come-First-Serve (FCFS)
 
Chapter 3 - Processes
Chapter 3 - ProcessesChapter 3 - Processes
Chapter 3 - Processes
 
Chapter 2: Operating System Structures
Chapter 2: Operating System StructuresChapter 2: Operating System Structures
Chapter 2: Operating System Structures
 
Semaphores
SemaphoresSemaphores
Semaphores
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Kernel. Operating System
Kernel. Operating SystemKernel. Operating System
Kernel. Operating System
 
Mainframe systems
Mainframe systemsMainframe systems
Mainframe systems
 

En vedette

En vedette (20)

Process management
Process managementProcess management
Process management
 
Management process powerpoint
Management process powerpointManagement process powerpoint
Management process powerpoint
 
Processes of management
Processes of managementProcesses of management
Processes of management
 
process management
 process management process management
process management
 
Chapter 5 Process Management
Chapter 5 Process ManagementChapter 5 Process Management
Chapter 5 Process Management
 
Management process
Management processManagement process
Management process
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File Management
 
Process management in os
Process management in osProcess management in os
Process management in os
 
Operating Systems: Processor Management
Operating Systems: Processor ManagementOperating Systems: Processor Management
Operating Systems: Processor Management
 
Management ppt
Management pptManagement ppt
Management ppt
 
Memory management
Memory managementMemory management
Memory management
 
Operating system - Process and its concepts
Operating system - Process and its conceptsOperating system - Process and its concepts
Operating system - Process and its concepts
 
Operating Systems - Network Management
Operating Systems - Network ManagementOperating Systems - Network Management
Operating Systems - Network Management
 
Os Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual MemoryOs Swapping, Paging, Segmentation and Virtual Memory
Os Swapping, Paging, Segmentation and Virtual Memory
 
Functions Of Operating Systems
Functions Of Operating SystemsFunctions Of Operating Systems
Functions Of Operating Systems
 
Processor management
Processor managementProcessor management
Processor management
 
Boot process
Boot processBoot process
Boot process
 
Booting of Computer System
Booting of Computer SystemBooting of Computer System
Booting of Computer System
 
Booting Process OS
Booting Process OSBooting Process OS
Booting Process OS
 
Process of operating system
Process of operating systemProcess of operating system
Process of operating system
 

Similaire à Operating Systems - Processor Management

CSI-503 - 2. Processor Management
CSI-503 - 2. Processor ManagementCSI-503 - 2. Processor Management
CSI-503 - 2. Processor Managementghayour abbas
 
Unit 2_OS process management
Unit 2_OS process management Unit 2_OS process management
Unit 2_OS process management JayeshGadhave1
 
Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...ApurvaLaddha
 
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 Systems chap 2_updated2 (1).pptx
Operating Systems chap 2_updated2 (1).pptxOperating Systems chap 2_updated2 (1).pptx
Operating Systems chap 2_updated2 (1).pptxAmanuelmergia
 
Operating Systems chap 2_updated2.pptx
Operating Systems chap 2_updated2.pptxOperating Systems chap 2_updated2.pptx
Operating Systems chap 2_updated2.pptxAmanuelmergia
 
Operating System-Concepts of Process
Operating System-Concepts of ProcessOperating System-Concepts of Process
Operating System-Concepts of ProcessShipra Swati
 
Lecture 2- Processes.pdf
Lecture 2- Processes.pdfLecture 2- Processes.pdf
Lecture 2- Processes.pdfAmanuelmergia
 
OS_Unit II - Process Management_CATI.pptx
OS_Unit II - Process Management_CATI.pptxOS_Unit II - Process Management_CATI.pptx
OS_Unit II - Process Management_CATI.pptxGokhul2
 
Operating System
Operating SystemOperating System
Operating SystemGowriLatha1
 
VCE_Process_UNIT-1 (1).pptx
VCE_Process_UNIT-1 (1).pptxVCE_Process_UNIT-1 (1).pptx
VCE_Process_UNIT-1 (1).pptxvamshimiryala1
 
Unit 2 part 1(Process)
Unit 2 part 1(Process)Unit 2 part 1(Process)
Unit 2 part 1(Process)WajeehaBaig
 

Similaire à Operating Systems - Processor Management (20)

CSI-503 - 2. Processor Management
CSI-503 - 2. Processor ManagementCSI-503 - 2. Processor Management
CSI-503 - 2. Processor Management
 
UNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdfUNIT - 3 PPT(Part- 1)_.pdf
UNIT - 3 PPT(Part- 1)_.pdf
 
Lecture 2 process
Lecture 2   processLecture 2   process
Lecture 2 process
 
Unit 2_OS process management
Unit 2_OS process management Unit 2_OS process management
Unit 2_OS process management
 
Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...Process management- This ppt contains all required information regarding oper...
Process management- This ppt contains all required information regarding oper...
 
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
 
Ch03- PROCESSES.ppt
Ch03- PROCESSES.pptCh03- PROCESSES.ppt
Ch03- PROCESSES.ppt
 
Operating Systems chap 2_updated2 (1).pptx
Operating Systems chap 2_updated2 (1).pptxOperating Systems chap 2_updated2 (1).pptx
Operating Systems chap 2_updated2 (1).pptx
 
OS-Process.pdf
OS-Process.pdfOS-Process.pdf
OS-Process.pdf
 
Operating Systems chap 2_updated2.pptx
Operating Systems chap 2_updated2.pptxOperating Systems chap 2_updated2.pptx
Operating Systems chap 2_updated2.pptx
 
Process
ProcessProcess
Process
 
Operating System-Concepts of Process
Operating System-Concepts of ProcessOperating System-Concepts of Process
Operating System-Concepts of Process
 
Lecture 2- Processes.pdf
Lecture 2- Processes.pdfLecture 2- Processes.pdf
Lecture 2- Processes.pdf
 
Chapter 3.pdf
Chapter 3.pdfChapter 3.pdf
Chapter 3.pdf
 
OS_Unit II - Process Management_CATI.pptx
OS_Unit II - Process Management_CATI.pptxOS_Unit II - Process Management_CATI.pptx
OS_Unit II - Process Management_CATI.pptx
 
OS (1).pptx
OS (1).pptxOS (1).pptx
OS (1).pptx
 
Operating System
Operating SystemOperating System
Operating System
 
Processing management
Processing managementProcessing management
Processing management
 
VCE_Process_UNIT-1 (1).pptx
VCE_Process_UNIT-1 (1).pptxVCE_Process_UNIT-1 (1).pptx
VCE_Process_UNIT-1 (1).pptx
 
Unit 2 part 1(Process)
Unit 2 part 1(Process)Unit 2 part 1(Process)
Unit 2 part 1(Process)
 

Plus de Damian T. Gordon

Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.Damian T. Gordon
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to MicroservicesDamian T. Gordon
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud ComputingDamian T. Gordon
 
Evaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONSEvaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONSDamian T. Gordon
 
Evaluating Teaching: MERLOT
Evaluating Teaching: MERLOTEvaluating Teaching: MERLOT
Evaluating Teaching: MERLOTDamian T. Gordon
 
Evaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson RubricEvaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson RubricDamian T. Gordon
 
Designing Teaching: Pause Procedure
Designing Teaching: Pause ProcedureDesigning Teaching: Pause Procedure
Designing Teaching: Pause ProcedureDamian T. Gordon
 
Designing Teaching: ASSURE
Designing Teaching: ASSUREDesigning Teaching: ASSURE
Designing Teaching: ASSUREDamian T. Gordon
 
Designing Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning TypesDesigning Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning TypesDamian T. Gordon
 
Designing Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of InstructionDesigning Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of InstructionDamian T. Gordon
 
Designing Teaching: Elaboration Theory
Designing Teaching: Elaboration TheoryDesigning Teaching: Elaboration Theory
Designing Teaching: Elaboration TheoryDamian T. Gordon
 
Universally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some ConsiderationsUniversally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some ConsiderationsDamian T. Gordon
 

Plus de Damian T. Gordon (20)

Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.Universal Design for Learning, Co-Designing with Students.
Universal Design for Learning, Co-Designing with Students.
 
Introduction to Microservices
Introduction to MicroservicesIntroduction to Microservices
Introduction to Microservices
 
REST and RESTful Services
REST and RESTful ServicesREST and RESTful Services
REST and RESTful Services
 
Serverless Computing
Serverless ComputingServerless Computing
Serverless Computing
 
Cloud Identity Management
Cloud Identity ManagementCloud Identity Management
Cloud Identity Management
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
 
Introduction to Cloud Computing
Introduction to Cloud ComputingIntroduction to Cloud Computing
Introduction to Cloud Computing
 
Introduction to ChatGPT
Introduction to ChatGPTIntroduction to ChatGPT
Introduction to ChatGPT
 
How to Argue Logically
How to Argue LogicallyHow to Argue Logically
How to Argue Logically
 
Evaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONSEvaluating Teaching: SECTIONS
Evaluating Teaching: SECTIONS
 
Evaluating Teaching: MERLOT
Evaluating Teaching: MERLOTEvaluating Teaching: MERLOT
Evaluating Teaching: MERLOT
 
Evaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson RubricEvaluating Teaching: Anstey and Watson Rubric
Evaluating Teaching: Anstey and Watson Rubric
 
Evaluating Teaching: LORI
Evaluating Teaching: LORIEvaluating Teaching: LORI
Evaluating Teaching: LORI
 
Designing Teaching: Pause Procedure
Designing Teaching: Pause ProcedureDesigning Teaching: Pause Procedure
Designing Teaching: Pause Procedure
 
Designing Teaching: ADDIE
Designing Teaching: ADDIEDesigning Teaching: ADDIE
Designing Teaching: ADDIE
 
Designing Teaching: ASSURE
Designing Teaching: ASSUREDesigning Teaching: ASSURE
Designing Teaching: ASSURE
 
Designing Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning TypesDesigning Teaching: Laurilliard's Learning Types
Designing Teaching: Laurilliard's Learning Types
 
Designing Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of InstructionDesigning Teaching: Gagne's Nine Events of Instruction
Designing Teaching: Gagne's Nine Events of Instruction
 
Designing Teaching: Elaboration Theory
Designing Teaching: Elaboration TheoryDesigning Teaching: Elaboration Theory
Designing Teaching: Elaboration Theory
 
Universally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some ConsiderationsUniversally Designed Learning Spaces: Some Considerations
Universally Designed Learning Spaces: Some Considerations
 

Dernier

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
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
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
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxdhanalakshmis0310
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
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
 
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
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
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
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 

Dernier (20)

Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
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)
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
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.
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
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
 
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
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
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Ữ Â...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 

Operating Systems - Processor Management

  • 2.  If you were assembling some IKEA furniture, and following the step-by-step guide of 20 steps.  Imagine you did step 1, then step 2, then step 3, suddenly the doorbell rang, and you are interrupted.
  • 3.  You would stop what you are doing and deal with whoever is at the door.  Then you would return to the assembly, check what step you were on, and then continue on from there (step 4).
  • 4.  This is how the computer runs multiple processes simultaneously … you do a few steps on one process, get interrupted, work on other processes, then return to the first process, remembering where you left off from, and continue on.  This swapping of processes is called a pre- emptive scheduling policy.
  • 5.  A “Process” is the basic unit of execution in the operating system  A “Process” is the name we give to a program when it is running in memory ◦ So a “Program” is the complied executable ◦ And a “Process” is the running executable with the execution state.
  • 6.  The same program being run by two different users in the operating system are two different processes User 1 Process 1 Running Executable 1 Execution State 1 User 2 Process 2 Execution State 2 Running Executable 1
  • 7.  The Processor Manager is made up of two sub-managers: Process Scheduler Job Scheduler
  • 9.  We describe a collection of processes as a “job”.  When the operating systems is presented with a queue of jobs or processes to run, the Job Scheduler has the task of deciding which order to run the are jobs in.  The Job Scheduler wants to ensure that the all components of the operating system are busy, and there is no component that is idle.
  • 10.  Let’s think about this program: PROGRAM PrintValue: BEGIN Input A; Input B; C = A + B; D = A – B; Print “The sum of inputs is: “, C; Print “The Difference of inputs is: “, D; END.
  • 11. I/O  Let’s think about this program: PROGRAM PrintValue: BEGIN Input A; Input B; C = A + B; D = A – B; Print “The sum of inputs is: “, C; Print “The Difference of inputs is: “, D; END.
  • 12. I/O  Let’s think about this program: PROGRAM PrintValue: BEGIN Input A; Input B; C = A + B; D = A – B; Print “The sum of inputs is: “, C; Print “The Difference of inputs is: “, D; END. Reading from keyboard
  • 13. I/O I/O  Let’s think about this program: PROGRAM PrintValue: BEGIN Input A; Input B; C = A + B; D = A – B; Print “The sum of inputs is: “, C; Print “The Difference of inputs is: “, D; END.
  • 14. I/O I/O  Let’s think about this program: PROGRAM PrintValue: BEGIN Input A; Input B; C = A + B; D = A – B; Print “The sum of inputs is: “, C; Print “The Difference of inputs is: “, D; END. Writing To screen
  • 15. CPU I/O I/O  Let’s think about this program: PROGRAM PrintValue: BEGIN Input A; Input B; C = A + B; D = A – B; Print “The sum of inputs is: “, C; Print “The Difference of inputs is: “, D; END.
  • 16. CPU I/O I/O  Let’s think about this program: PROGRAM PrintValue: BEGIN Input A; Input B; C = A + B; D = A – B; Print “The sum of inputs is: “, C; Print “The Difference of inputs is: “, D; END. Doing computation
  • 17. CPU I/O I/O  Some programs do a lot of I/O, e.g. Graphics programs:
  • 18.  Others do a lot of computation, but little I/O, e.g. maths programs: CPU I/O I/O
  • 19.  If the job scheduler gets jobs like this:
  • 20.  If the job scheduler gets jobs like this:
  • 21.  So the job scheduler will take these jobs:
  • 22.  And swap them around, and pass them onto the Process Scheduler
  • 23.  So in this case the Job Scheduler wants to balance the jobs coming in, so that the components of the operating system are all kept busy.  If we don’t change the order of job, the CPU will be very busy, but the I/O component will be idle, and then vice versa.  This is not an optimal use of resources, so we swap them around.
  • 24.  We'll call jobs that are CPU-bound Batch Jobs, and we’ll call jobs that have a lot of I/O operations Interactive Jobs.
  • 25.  This is the first level of swapping of processes that will occur, and more will be done by the Process Scheduler. The Job Scheduler is looking at jobs (or groups of processes), and looking at the whole process from a high-level.  For obvious reasons, the Job Scheduler is also called the High-Level Scheduler.
  • 26.  Every process has a field that records their current status, called the Process Status.  When the process is first passed to the Job Scheduler from the operating system, its status is always set as HOLD.  When the Job Scheduler passes the process onto the Process Scheduler, its status is always changed to READY.
  • 28.  Other statuses that a process can have are: Process Scheduler Job SchedulerHOLD WAITING READY RUNNING FINISHED
  • 30. Scheduler Dispatch Interrupt Admitted Exit I/O or Event wait I/O or Event completion HOLD READY WAITING RUNNING FINISHED
  • 31.  Think about traffic lights:
  • 32.  This is the sequence:
  • 33.  As mentioned previously the process is first passed to the Job Scheduler from the operating system, its status is always set as HOLD. When the Job Scheduler passes the process onto the Process Scheduler, its status is always changed to READY.
  • 34.  When the CPU is available, the Process Scheduler will look at all of the upcoming processes and will select one of them (based on a predefined algorithm) and assuming there is memory free, the process will start running and its status is changed to RUNNING by the Process Scheduler.
  • 35.  After a predefined time, the process will be interrupted, and another process will take over the CPU, and the interrupted process will have its status changed to READY by the Process Scheduler. We will remember that this swapping of processes is called a pre- emptive scheduling policy.  When is CPU is available for this process again the process status be changed to RUNNING by the Process Scheduler.
  • 36.
  • 37.  If the process has to wait for some I/O from the user or some other event, it is put in a status of WAITING by the Process Scheduler.  When the I/O device lets the Process Scheduler know that the I/O is completed, the process status will be changed to READY by the Process Scheduler.
  • 38.  Finally the process status will be changed to FINISHED either when the process has successful completed, or if an error occurs and the process has to terminate prematurely. The status change is usually handled by the Process Scheduler informing the Job Scheduler of the process completion, and the Job Scheduler of changing the status.
  • 40.  The Process status is only one of a collection of descriptors that are associated with a process.  Each process has a data structure called a Process Control Block (PCB) associated with it, rather like a passport.
  • 42. Process ID Process Status Process State • Program Counter • Register Contents • Main Memory • Resources • Process Priority Accounting
  • 43.  PROCESS IDENTIFIER ◦ Each process is uniquely identified by both the user’s identification, and a pointer connecting it to its descriptor.
  • 44.  PROCESS STATUS ◦ The current status of the process, it is either: HOLD READY WAITING RUNNING FINISHED
  • 45.  PROCESS STATE ◦ Program counter ◦ Record the current value of the program counter 0708
  • 46.  PROCESS STATE ◦ Register Contents ◦ Record the values of the data registers
  • 47. 9 10 11 12 13 14 15 16 18 19 1 2 3 4 5 6 7 8 0 17 20  PROCESS STATE ◦ Main Memory ◦ Record all important information from memory, including most importantly the process location.
  • 48.  PROCESS STATE ◦ Resources ◦ Record the resources that have been allocated to this job, including files, disk drives, and printers. ID TYPE DETAILS 1 FILE TXT file starting at memory address 0x456 2 FILE DAT file starting at memory address 0x087 3 DISK Disk Drive 4 4 FILE TXT file starting at memory address 0x673 5 PRINTER Printer at IP address 172.242.34.65
  • 49.  PROCESS STATE ◦ Process Priority ◦ The process is assigned a priority, and if the operating system using priorities to schedule processes.
  • 50.  PROCESS STATE ◦ Process Priority ◦ The process is assigned a priority, and if the operating system using priorities to schedule processes. 12 54 66 23 13 32
  • 51.  PROCESS STATE ◦ Process Priority ◦ The process is assigned a priority, and if the operating system using priorities to schedule processes. 12 54 66 23 13 32 1 1 5 2 1 1
  • 52.  ACCOUNTING ◦ This section records some of the performance statistics associated with this process, including:  CPU time used so far  Time process has been in the system  Time taken in memory (Main and secondary)  Space taken in memory (Main and secondary)  System programs used, compliers, editors, etc.  Number and type of I/O operations  Time spent waiting for I/O operations completion  Number of Input records read and Output records written
  • 53. Process ID Process Status Process State • Program Counter • Register Contents • Main Memory • Resources • Process Priority Accounting
  • 54. 457 “WAITING” Process State • 245 • R1:23, R2:63, R3:71 • Process Address: 345 • File1, File5, Disk4 • 5 CPU: 3, Total Time:34….. Process ID Process Status Process State • Program Counter • Register Contents • Main Memory • Resources • Process Priority Accounting
  • 55.
  • 56.  What are good policies to schedule processes?
  • 57.  MAXIMUM THROUGHPUT  Get as many jobs done as quickly as possible.  There are several ways to achieve this, e.g. run only short jobs, run jobs without interruptions.
  • 58.  MINIMIZE RESPONSE TIME  Ensure that interactive requests are dealt with as quickly as possible.  This could be achieved by scheduling just with a lot of I/O jobs first, and leave the computational jobs for later.
  • 59.  MINIMIZE TURNAROUND TIME  Ensure that jobs are completed as quickly as possible.  This could be achieved by scheduling just with a lot of computation jobs first, and leave the I/O jobs for later, so there is no user delays.
  • 60.  MINIMIZE WAITING TIME  Move jobs out of the READY status as soon as possible.  This could be achieved by reduce the number of users allowed on the system, so that the CPU would be available whenever a job enters the READY status.
  • 61.  MINIMIZE WAITING TIME  Move jobs out of the READY status as soon as possible.  This could be achieved by reduce the number of users allowed on the system, so that the CPU would be available whenever a job enters the READY status.
  • 62.  MAXIMISE CPU EFFICIENCY  Keep the CPU busy 100% of the time.  This could be achieved by scheduling just with a lot of computation jobs, and never run the I/O jobs.
  • 63.  ENSURE FAIRNESS FOR ALL JOBS  Give everyone an equal amount of CPU time and I/O time.  This could be achieved by giving all jobs equal priority, regardless of it’s characteristics.
  • 64.
  • 65.  Here are six commonly used process scheduling algorithms
  • 66.  First Come, First Served (FCFS)  A very simple algorithm that uses a FIFO structure.  Implemented as a non-pre-emptive scheduling algorithm.  Works well for Batch Processes, where users don’t expect any interaction.
  • 67.  Shortest Job Next (SJN)  Also called Shortest Job First (SJF).  A very simple algorithm that schedules processes based on CPU cycle time.  Implemented as a non-pre-emptive scheduling algorithm.  Works well for Batch Processes, where it is easy to estimate CPU time.
  • 68.  Priority Scheduling  An algorithm that schedules processes based on priority.  Implemented as a non-pre-emptive scheduling algorithm.  One of the most common algorithms used in systems that are mainly Batch Processes.  If two jobs come in of equal priority are READY, if works on a FIRST COME, FIRST SERVED basis.
  • 69.  Shortest Remaining Time (SRT)  A pre-emptive scheduling version of the Shortest Job Next (SJN) algorithm.  An algorithm that schedules processes based on the one which is nearest to completion.  It can only be implemented on systems that are only Batch Processes, since you have to know the CPU time required to complete each job.
  • 70.  Round Robin  A pre-emptive scheduling algorithm that is used extensively in interactive systems  All active processes are given a pre- determined slice of time (“time quantum”).  Choosing the time quantum is the key decision, for interactive systems the quantum must be small, whereas for batch systems it can be longer.
  • 71.  Multi-Level Queues  This isn’t really a separate scheduling algorithm, it can be used with others.  Jobs are grouped together based on common characteristics.  For example, CPU-bound jobs based in one queue, and the I/O-bound jobs in another queue, and the process scheduler can select jobs from each queue based on balancing the load.