You are on page 1of 11

REAL-TIME CPU

SCHEDULING
By: Shivani Kaintura
2015HW69809
Section E
 CPU Scheduling-

It is a process which allows one process


top use the CPU while the execution of
other process is on hold due to any
resource like I/O etc.

The aim of CPU scheduling is to make the


system efficient, fast and fair.
 Real-time processes are often specified as having
a start time (release time) and a stop time (deadline)

 The release time is the time at which the process


must start after some event occurred that triggered
the process.

 Hard Deadline: It is when there is no value to the


computation if it completes after the deadline.

 E.g : Suppose that a collision sensor interrupt must


start airbag deployment within 20 msec. of sense
time. The deadline is the time by which the task must
complete. The scheduler must allot enough CPU time
to the job so that the task can indeed complete.
There are several times of deadlines.
Soft deadline:
The value of a late result diminishes but
doesn't immediately disappear with time.

E.g: Consider a video server that is


required to generate 30 video frames per
second. This means that a frame has to be
generated every 33.3 milliseconds.
If it is 40 milliseconds late ,then we expect
to present the next frame and there is no
value in the current data.
Process types

 Terminating Processes

 Nonterminating processes
- Periodic
- Aperiodic
 Terminating processes:

A terminating process may be considered


as one that runs and then terminates.

Its deadline is the time that at which it


should complete all its work and its
compute time is the amount of CPU time it
needs.
 Nonterminating processes:

For processes such as video and audio servers as well as


editors, we are not interested in the terminating time of
these processes but rather in the time between events.

For example, we would like our audio server to fill a 4K byte


audio buffer every 500 milliseconds or we would like our
video server to provide a new video frame every 33.3
milliseconds. For these processes, the compute time is the
CPU time that the process needs to compute its periodic
event and the deadline is the time at which it must have the
results ready. Nonterminating processes may be divided into
two classes:

-Periodic
-Aperiodic
 Periodic:

A periodic process has a fixed frequency at


which it needs to run. For example, a video
decompressor may have to run 30 times
per second at 33.3 millisecond intervals.
 Aperiodic:

A periodic processes have no fixed, cyclical,


frequency between events. Event interrupts
may occur sporadically and event
computation times may vary dramatically.
For purposes of scheduling, we use the
shortest period and the longest
computation time to play it safe.
If C represents our computation time
and D represents the deadline, the following
relation must hold:

C≤D

If the period of the process is T, the following


relation must now hold:

C≤D≤T
Thank you

You might also like