Scheduling is a set of policies and mechanisms used by an operating system to control the order of processes waiting to use the CPU. The scheduler assigns resources and decides which ready processes will run next, while the dispatcher loads the chosen process into the CPU. Fairness, response time, efficiency, turnaround time, and throughput are important scheduling considerations. Processes can be in various states like new, ready, running, waiting, and terminated. Scheduling is performed by both long-term and short-term schedulers using algorithms like priority scheduling, shortest job first, round robin, and fair share. Real-time systems also use special real-time scheduling policies.
3. SCHEDULER AND DISPATCHER
SCHEDULER: DISPATCHER:
The part of an operating system The operating system component
which assigns resources to which moves one task at a time
processes, or tasks. from a ready queue to the run state.
The dispatcher is also referred to as
the short term scheduler.
5. Fairness: A scheduler makes sure that each process gets
its fair share of the CPU and no process can suffer
indefinite postponement.
Response time: The length of time it takes to react to
a given stimulus or event.
Efficiency: A level of performance that describes a
process that uses the lowest amount of inputs to create
the greatest amount of outputs.
6. Turnaround: The process of completing or the time
needed to complete a task, esp. one involving receiving
something, processing it, and sending it.
Throughput: The amount of material or items
passing through a system or process.
Policy Enforcement: The scheduler has to make
sure that system's policy is enforced. For example, if
the local policy is safety then the safety control
processes must be able to run whenever they want to.
7. Process States
New Terminated
Ready Running
Waiting
Swapping
8. Continued….
New: A file is loaded from storage to memory.
Ready: Process has been loaded into main
memory and is awaiting execution on a CPU.
Running: A process moves into the running
state when it is chosen for execution.
Swapping: Moving the process from main
memory to virtual memory.
Terminated: Either from the "running" state
by completing its execution or by explicitly being
killed.
9. SCHEDULING LEVELS
LONG TERM SCHEDULER:
The part of an operating system which
places new tasks into the ready state.
SHORT TERM SCHEDULER:
The short-term scheduler, decides which of
the ready in-memory processes are to be
executed next.
It makes decisions more frequently than
long term scheduler
10. PREEMPTIVE & NONPREEMPTIVE SCHEDULING
PREEMPTIVE SCHEDULING:
Operating system act of interrupting a
running task, removing it from the run
state, and placing it in the ready state.
Modern operating systems are typically
preemptive. In this type of scheduling the
priority of a process is gradually reduced
while it is running.
NON PREEMPTIVE SCHEDULING:
When process gets into CPU, it keeps it until
it goes into Wait or terminates. It allows a
task to remain in the run state until it
voluntarily blocks or completes.
11. Priority
Shortest Priority
Remaining Aging
Time
Scheduling
Algorithms
Fair
FIFO
Share
Round
SJF Robin
12. Priority……
Processes scheduling in which
the scheduler selects tasks to run based on
their priority.
A danger of priority scheduling is starvation,
in which processes with lower priorities are
not given the opportunity to run.
13. Types of Priorities
A priority which is not
automatically adjusted by the
system. It can be changed by a
User or Super user.
A priority which is adjusted
automatically by the system
according to task behavior and
system loading. It improves
response time and eliminate
indefinite postponent.
14. Shortest Remaining Time: A scheduling policy which
schedules tasks in ascending order of estimated
remaining processing time.
FIFO (First In First Out): A scheduling policy which
schedules tasks in the same order in which they enter
the ready state.
Round Robin: A scheduling policy which scheduleses
tasks in a fixed circular order. It is used for time
sharing users.
15. Priority Aging: A process which dynamically raises the
priority of a task according to the time it has been
waiting in the ready queue.
SJF (Shortest Job First): A scheduling policy which
schedules tasks in ascending order of estimated
processing time.
Fair Share: A scheduling policy which assigns tasks to
groups, and allocates a percentage of CPU time to
each group.
16. Real Time Scheduling
A system which must respond in real
time to changing conditions. Real
time systems are used for
controlling industrial processes, cars,
robots, and other time critical
applications. They have fixed sets of
tasks. Reliability is also an important
goal for real time systems.