Escolar Documentos
Profissional Documentos
Cultura Documentos
Evolution of OS
Serial Processing
Simple Batch System
Multiprogrammed Batch
Systems
Multitasking/Time
Sharing
Process
Design
Monolithic
Layered systems
Microkernel
Creation/Termination
5-state process model
Blocked/Waiting, Exit
Queuing model
Suspended Process
Concept of Mechanisms
(what/how to do?) And
Policies (which?)
Process treats an OS as a
set of APIs
CPU Virtualization an
illusion by the OS
Process preemption
Process/Context
switching kernel, trap
tables
System/User level
CPU / I/O-bound
Cooperative / NC
OS Ctrl structures
OS Ctrl Tables
Modes of Execution
Process Switching
Role of schedulers
Types of schedulers
New job
Interactive logon
Created for OS service
Spawn by existing process
Process
Evolution of OS
Serial Processing
Simple Batch System
Multiprogrammed Batch
Systems
Multitasking/Time
Sharing
Design
Monolithic
Layered systems
Microkernel
Creation/Termination
5-state process model
Blocked/Waiting, Exit
Queuing model
Suspended Process
Process preemption
Process/Context
switching
System/User level
CPU / I/O-bound
Cooperative
OS Ctrl structures
OS Ctrl Tables
Modes of Execution
Process Switching
Role of schedulers
Types of schedulers
Process
Evolution of OS
Serial Processing
Simple Batch System
Multiprogrammed Batch
Systems
Multitasking/Time
Sharing
Design
Monolithic
Layered systems
Microkernel
Creation/Termination
5-state process model
Blocked/Waiting, Exit
Queuing model
Suspended Process
Process preemption
Process/Context
switching
System/User level
CPU / I/O-bound
Cooperative
Normal completion
Time limit exceeded
Mem unavailable
Protection error
Arithmetic error
Time overrun (wait)
I/O failure
Privileged instruction
OS intervention
OSParent
Ctrltermination
structures
OSParent
Ctrl Tables
request
Modes of Execution
Process Switching
Role of schedulers
Types of schedulers
Process
Can affect the execution
Evolution of OS
Serial Processing
Simple Batch System
Multiprogrammed Batch
Systems
Multitasking/Time
Sharing
Design
Monolithic
Layered systems
Microkernel
Process
Block
of otherControl
processes
Role of Dispatcher
Can be
affectedmodel
by
2-state
process
other processes
Creation/Termination
5-state process model
Share data with
New,
Ready, Run,
other
processes
Blocked/Waiting, Exit
Queuing model
Suspended Process
Process preemption
Process/Context
switching
System/User level
CPU / I/O-bound
Cooperative
OS Ctrl structures
OS Ctrl Tables
Modes of Execution
Process Switching
Role of schedulers
Types of schedulers
Process
Role of Dispatcher
stack etc.
User Data program data, user
2-state process model
Serial
Processing
PCB Data needed by OS to control
Simple
Batch
System
the process
Blocked/Waiting, Exit
Multiprogrammed Batch
Queuing model
Multitasking/Time
Suspended Process
Sharing
Design
Monolithic
Layered systems
Microkernel
Process preemption
Process/Context
switching
System/User level
CPU / I/O-bound
Cooperative
OS Ctrl structures
OS Ctrl Tables
Modes of Execution
Process Switching
Role of schedulers
Types of schedulers
Process
PCB
Process Identification
Evolution
of
OS
(pid, ppid, uid)
Serial Processing
Simple Batch
Processor
StateSystem
Info.
Multiprogrammed
Batch
(user-visible
registers,
Systems registers,
Control/Status
Multitasking/Time
Stack pointers)
Sharing
Design
Process
data structuring,
Monolithic comm.,
Inter-process
Layered
Process privileges,
systems
Memory mgmt.,
Microkernel
Resource ownership
And utilization)
Creation/Termination
5-state process model
Blocked/Waiting, Exit
Queuing model
Suspended Process
Process preemption
Process/Context
switching
System/User level
CPU / I/O-bound
Cooperative
OS Ctrl structures
OS Ctrl Tables
Modes of Execution
Process Switching
Role of schedulers
Types of schedulers
Process
Evolution of OS
Serial Processing
Simple Batch System
Multiprogrammed Batch
Systems
Multitasking/Time
Sharing
Design
Monolithic
Layered systems
Microkernel
Creation/Termination
5-state process model
Blocked/Waiting, Exit
Queuing model
Suspended Process
OS Ctrl structures
Process preemption
Process/Context
switching
Assign a unique pid
System/User
Allocate
space for thelevel
process
CPU
/ I/O-bound
Initialize
the PCB
Cooperative
Set the
appropriate linkages
OS Ctrl Tables
Modes of Execution
Process Switching
Role of schedulers
Types of schedulers
Scheduling Goals
Scheduling Goals
Performance
Throughput
Response Time
Throughput - Rate at which useful work is accomplished, e.g, search transaction on Google.
Many context switch not good for high throughput,
but may be necessary for quick response time.
Remember: It is not only CPU, efficient
use of I/O, memory efficiently, a
scheduler can maximize throughput.
Scheduling Mechanism
Non-preemptive vs. Preemptive
Visualization
Uniprocessor
Scheduling
Focus:
State
of
Ready
Queue
Policy dependent
Unless the first queue is empty, the next queue will not be considered in
scheduling other processes.
In case of 3 queues, queue 2 not processed until queue 1 gets empty, queue 3
not processed until queues 1 and 2 get empty.
For e.g., FCFS (t > 10), SPN(t < 5), SRTN(5 < t < 10)
In case different queue ordering is considered, it is possible to reach to
different schedules suggesting multiple ways to schedule a given set of
processes.
Scheduler scans all queues based on queue ordering.
HRRN,
Multi-level Queue
(q=1,2,3)
Feedback (q=1), (q=2^n)
Example 2
Example 3
FCFS,
RR (q=1),
RR(q=4),
SPN/SJF,
SRT/SRTN,
HRRN,
Multi-level Feedback (q=2),
Multi-level Feedback (RR=1,SRT, HRRN)
Remember:
For HRRN (is preemptive when time quantum is given) when used in MLFQ scheduling
Response Ratio = (WT + RST) / RST,
where WT indicates waiting time w.r.to arrival time, and
RST indicates remaining service time based on status of a process in a particular queue.
RST = Total service time time for which CPU has already been assigned to that process.
When policies like SJF, SRT, HRRN are used in context of feedback scheduling, each of
these policies are only used for process selection from the queue. However, CPU time is
given only for a given/assumed time slot, and then the process is moved to next queue if it is
not yet completed.
Example 4
b) Draw a chart showing execution of processes using SRTN. For each process, calculate the
total time spent in the Ready queue.
c) Draw a chart showing execution of processes using HRRN.
d) Draw charts for the MLFQ (4 queues, q=2n+1, n=0,1,2,3)
Example 5
Example 6
FCFS
RR(q=1,2,4)
SPN(Shortest Process Next, Non-preemptive)
SRTN (a.k.a. PSPN(Shortest Process Next, preemptive))
HRRN
Preemptive HRRN
MLFQ (q=2n+1, n={0,0.5,1,1.5})
Solution 6
Solution 6 ...cont'd
Solution 6...cont'd
RR (q = 1)
Example 7
(a) The system uses RR scheduling with q=10 ms and q=5 ms.
(b) The system uses MLFQ scheduling with 4 queues, q=2n-1, where n=1,2,3,4
Solution 7 (a)
Time
CPU Use
Ready Queue
(end of time slot)
I/O Use
Example 8
Consider the following three processes. Each process makes a CPU burst
then an I/O burst, another CPU burst, another I/O burst and terminates
with a CPU burst. The lengths of the CPU burst and I/O burst times in
milliseconds are given in the following table:
Process
CPU-burst1
I/O-burst1 CPU-burst2
I/O-burst2 CPU-burst3
Arrival
P1
P2
P3
Soluiton 8
Example 9