Anda di halaman 1dari 23

PROCESS SCHEDULING

SUBMITTED
TO:
Dr. Sonal Jain

SUBMITTED BY:
Chandrika Singh
Ritu Sharma
Riya Choudhary

Introduction
Incomputer science,schedulingis the
method by whichprocessesor
dataflowsare given access to system
resources. This is usually done to share
system resources effectively or achieve a
targetquality of service. The need for a
scheduling algorithm arises from the
requirement for most modern systems to
performmultitasking(executing more than
one process at a time).

Process Behaviour For


Scheduling
CPU BURST-when a process has long
computations to be executed by the
processor.
I/O BURST-the occurrence of I/O operation.
CPU BOUND-process with intensive CPU-burst
i.e., longer CPU cycles and a low number of
I/O bursts
I/O BOUND-process has a large number of
frequent I/O bursts within the smaller CPUbursts

Scheduling Levels
Long-term scheduling
Medium-term scheduling
Short-term scheduling

Long-term scheduling
Long-term scheduling is done when
a new process is created. It initiates
processes and so controls the degree
of multi-programming (number of
processes in memory).

Medium term scheduling


Medium-term scheduling involves
suspending or resuming processes by
swapping (rolling) them out of or into
memory

Short term scheduling


Short-term (process or CPU)
scheduling occurs most frequently
and decides which process to
execute next.

Preemptive & Non-preemptive


Scheduling
Non-preemptive
Once CPU is allocated to a process, it
holds it till it gets completed.

Preemptive
Currently running process may be
interrupted and moved to the ready
state by the OS.

Process Scheduling Goals


The goals of scheduling may be categorised
as user-based scheduling goals and systembased scheduling goals.
User based goals are the criteria that benefit
the user. For e.g. a user in a multi user
environment expects the system to give
quick response to the job.
System based goals are the criteria that
benefit the system, i.e., performance of the
system. For e.g. how much the processor is
being utilized in processing the processes.

User-Based Scheduling
Goals:
Turnaround time time to execute a process:
from start to completion i.e. sum of
Waiting time,
Executing time
Blocked waiting for an event, for example waiting
for I/O

Waiting time time spend in waiting for CPU


during entire life time of a process.
Response time time from submission of
request to production of first response.
Predictability prediction about completion
time of a process by human mind.

System-Based Scheduling
Goals:
Throughput number of processes
that complete their execution per
unit time
CPU utilization percent time CPU is
busy
Fairness all processes should be
treated equal, until priority is set
Balance there should be a balance
between I/O bound and CPU bound
processes.

First Come First Serve


The arriving process is added onto
the tail of the queue and the process
at the head of the queue is
dispatched to the processor for
execution.
A process that has been interrupted
by any means does not maintain its
previous order in the ready queue.

Shortest-Job-First
Scheduling, SJF
The idea behind the SJF algorithm is to
pick the quickest fastest little job that
needs to be done, get it out of the way
first, and then pick the next smallest
fastest job to do next.
Technically this algorithm picks a
process based on the next shortestCPU
burst, not the overall process time.

Priority Scheduling
The processes are executed according to
the priority.
1.Priority number based scheduling
In it preference is given to the processes,
based on a priority number assigned to it.
2.Shortest Process Next(SPN)
The process with the shortest execution
time is executed first . It is non-preemptive scheduling algorithm.

Shortest Remaining Time Next(SRN)


This algorithm also considers the
execution time of processes as in
SPN. but it is a pre-emptive version
of SPN.

Round Robin Scheduling


Time slicesare assigned to each
process in equal portions and in
circular order, handling all processes
withoutpriority.
The design is such that whenever a
process finishes before the time slice
expires, the timer will stop and send
the interrupt signal ,so that the next
process can be scheduled.

Improved Round Robin


Scheduling
CPU consumption ratio=Actual CPU
time consumed/total estimated
execution time
Schedule a process if its CPU
consumption ratio is greater than
0.60, else schedule a process whose
CPU consumption ratio is minimum.

Multilevel Queue Scheduling


When processes can be readily categorized, then multiple
separate queues can be established, each implementing
whatever scheduling algorithm is most appropriate for that
type of job, and/or with different parametric adjustments.
Scheduling must also be done between queues, that is
scheduling one queue to get time relative to other queues.
Two common options are strict priority ( no job in a lower
priority queue runs until all higher priority queues are
empty ) and round-robin ( each queue gets a time slice in
turn, possibly of different sizes. )
Note that under this algorithm jobs cannot switch from
queue to queue - Once they are assigned a queue, that is
their queue until they finish.

Multilevel Feedback-Queue
Scheduling
Multilevel feedback queue scheduling is similar to the ordinary
multilevel queue scheduling described above, except jobs may be
moved from one queue to another for a variety of reasons:
If the characteristics of a job change between CPU-intensive and I/O intensive,
then it may be appropriate to switch a job from one queue to another.
Aging can also be incorporated, so that a job that has waited for a long time
can get bumped up into a higher priority queue for a while.

Multilevel feedback queue scheduling is the most flexible, because it


can be tuned for any situation. But it is also the most complex to
implement because of all the adjustable parameters. Some of the
parameters which define one of these systems include:
The number of queues.
The scheduling algorithm for each queue.
The methods used to upgrade or demote processes from one queue to
another. ( Which may be different. )
The method used to determine which queue a process enters initially.

Fair-share scheduling
Fair-share schedulingis a
scheduling strategy for
computeroperating systemsin which
theCPUusage is equally distributed
among system users or groups, as
opposed to equal distribution among
processes.

Lottery scheduling
In Lottery Scheduling processes are each assigned
some number oflottery tickets, and the scheduler draws
a random ticket to select the next process. The
distribution of tickets need not be uniform; granting a
process more tickets provides it a relative higher chance
of selection.
Lottery scheduling solves the problem ofstarvation.
Giving each process at least one lottery ticket guarantees
that it has non-zero probability of being selected at each
scheduling operation.
There are two good features of lottery scheduling:
o Ticket transfer
o Ticket inflation

Anda mungkin juga menyukai