Presentation:Operatin G System: Topic:CPU Scheduling and Real Time Scheduling
Presentation:Operatin G System: Topic:CPU Scheduling and Real Time Scheduling
Presentation:Operatin G System: Topic:CPU Scheduling and Real Time Scheduling
g System
Priority Algorithm
Round Robin Algorithm
Priority Scheduling:
Main Points:
Here is priority associated with each process.
At any instance of time, out of all available process, CPU is allocated to the
process which possess the highest priority(Number may be higher or lower).
Tie is broken using FCFS order.
No importance to A.T or B.T.
It supports both Non pre-emptive and pre-emptive versions.
Non Pre-emptive Approach:
Data and Gantt Chart:
Highest Priority=Highest Number in Priority Column
P1 P4 P5 P3 P2
0 4 9 11 12 15
Pre-emptive Approach:
Data and Gantt Chart:
Highest Priority=Highest Number in Priority Column
P1 P2 P3 P4 P5 P2 P1
0 1 2 3 8 10 12 15
Round Robin Algorithm:
Main Points:
This algorithm is designed for sharing system, when it is not necessary to complete one process and then
start another, but to be responsive and divide time of the CPU among the process in Ready state.
Here Ready queue will be treated as circular queue.
We fix a time quantum up to which a process can hold the CPU in one go, within which either a process
terminates or process must release the CPU and re-enter in the circular queue and wait for the next chance.
R-Robin is always pre-emptive in nature.
Pre-emptive Approach:
Data and Gantt Chart:
Time Quantum=Tq=2
P-id A.T B.T C.T TAT W.T
P0 0 5 13 13 8
P1 1 3 12 11 8
P2 2 1 5 3 2
P3 3 2 9 6 4
P4 4 3 14 10 7
P0 P1 P2 P0 P3 P4 P1 P0 P4
0 2 4 5 7 9 11 12 13 14
Multilevel Queue:
A process can move between the various queues; aging can be implemented this way
Aging :
ageing or aging is a Scheduling technique used to avoid Starvation.
Three queues:
Introduction
Types of real-time system
Issues in real-time system
Task categories in real-time systems
Scheduling algorithms
Real time Systems:
Real time: It is the time span taken by the system to complete all its tasks and provides
an output for an input. This time span should be the same for computation of all its
tasks.
Real time system: Real time systems are those which must produce the correct
response within the specified or defined time limit. If it exceeds these time bonds it
results in performance degradation and/or malfunction of system.
For example in aircraft engine control system, the real time control system should
perform its task within a specified time as the operator/pilot intended and failure of this
can cause the loss of control and possibly the loss of many lives.
Types of Real-time Systems:
Hard real-time Systems necessarily perform the task within the given specified
deadline. A formal guarantee of always meeting the hard deadline is required .
Examples include air traffic control, vehicle subsystems control and Nuclear power
plant control.
Soft real-time Systems are the RTOS that perform task almost in the specified
deadline. They do not guarantee a hard deadline. Task can be performed even after the
time has elapsed. Examples of Soft Time Operating Systems include multimedia
transmission and reception, networking, telecom (cellular) networks, web sites and
services and computer games.
Latency:
a time delay between the cause and the effect of some physical change in the system
being observed
Two types of latencies affect the performance of real-time systems
1. Interrupt latency : refers to the period of time from the arrival of an interrupt at the
CPU to the start of the routine that services the interrupt
2. Dispatch latency : The time it takes for the dispatcher to stop one process and start
another running is known as the dispatch latency.
Tasks Categories:
In Online scheduling a task executes with respect to its priority, which is determined in real
time according to specific rule and priorities of tasks may change during execution . The
online scheduling algorithm has two types. They are more flexible because they can change
the priority of tasks on run time according to the utilization factor of tasks
Static Priority: In fixed priority if the kth job of a task T1 has higher priority than the kth
job of task T2 according to some specified scheduling event, then every job of T1 will
always execute first then the job of T2 i.e. on next occurrence priority does not change. One
of best example of fixed priority algorithm is rate monotonic scheduling algorithm.
Dynamic Priority: In dynamic priority algorithm, different jobs of a task may have
different priority on next occurrence, it may be higher or it may be lower than the other
tasks. One example of a dynamic priority algorithm is the earliest deadline first algorithm.