0% found this document useful (0 votes)
15 views

Chapter 3 1

os
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Chapter 3 1

os
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 34

PROCESSES

Learning Outcomes:
1. To introduce the notion of a process – a
program in execution, which forms the basis of
all computation.
2. To describe the various features of processes,
including scheduling, creation, and termination.
3. To explore interprocess communication using
shared memory and message passing.
4. To describe communication in client-server
systems.
Topics:
• Process Concepts
• Process Scheduling
• The fork() System Call
• CPU Scheduling algorithms
• Scheduling Algorithms
• Round Robin Scheduling Algorithms
Scheduling Algorithms
1. First-Come, First-Served Scheduling
(FCFS)
Scheduling Algorithms
1. First-Come, First-Served Scheduling
(FCFS)
Scheduling Algorithms
2. Shortest-Job-First (SJF) Scheduling
• associates with each process the length
of the latter's next CPU burst.
• When the CPU is available, it is assigned
to the process that has the smallest
next CPU burst.
Scheduling Algorithms
2. Shortest-Job-First (SJF) Scheduling
Scheduling Algorithms
2. Shortest-Job-First (SJF) Scheduling
Scheduling Algorithms
2. Shortest-Job-First (SJF) Scheduling
Let tn be the length of time with CPU
burst, and let cn+1 be our predicted value
for the next CPU burst. Then, for a, 0 <= d
<= 1, define
Scheduling Algorithms
Scheduling Algorithms
Shortest-remaining-time-first scheduling
• A preemptive SJF algorithm will
preempt the currently executing
process, whereas a nonpreemptive SJF
algorithm will allow the currently
running process to finish its CPU burst.
Scheduling Algorithms
Scheduling Algorithms
Scheduling Algorithms
3. Priority Scheduling
• An SJF algorithm is simply a priority
algorithm where the priority (p) is the
inverse of the (predicted) next CPU
burst.
• The larger the CPU burst, the lower the
priority, and vice versa.
Scheduling Algorithms
3. Priority Scheduling
Scheduling Algorithms
3. Priority Scheduling
Scheduling Algorithms
Indefinite blocking or starvation
• A process that is ready to run but
lacking the CPU can be considered
blocked,waiting for the CPU.
Scheduling Algorithms
Aging
• technique of gradually increasing the
priority of processes that wait in the
system for a long time. For example, if
priorities range from 127(low) to 0 (high),
we could increment the priority of a
waiting process by 1 every 15 minutes.
Scheduling Algorithms
4. Round-Robin Scheduling
• designed especially for timesharing
systems.
• It is similar to FCFS scheduling, but
preemption is added to switch between
processes.
• A time quantum is generally from 10 to
100 milliseconds
Scheduling Algorithms
4. Round-Robin Scheduling
Scheduling Algorithms
4. Round-Robin Scheduling
Scheduling Algorithms
Processor sharing
• If the time quantum is extremely small
(say 1 microsecond)
• Appears to the users as though each of
n processes has its own processor
running at 1/n the speed of the real
processor
Scheduling Algorithms
Round Robin Scheduling Algorithm
1. The queue structure in ready queue is
of First In First Out (FIFO) type.
2. A fixed time is allotted to every
process that arrives in the queue. This
fixed time is known as time slice or
time quantum.
Scheduling Algorithms
Round Robin Scheduling Algorithm
3. The first process that arrives is selected
and sent to the processor for execution. If
it is not able to complete its execution
within the time quantum provided, then
an interrupt is generated using an
automated timer.
Scheduling Algorithms
Round Robin Scheduling Algorithm
4. The process is then stopped and is sent
back at the end of the queue. However,
the state is saved and context is thereby
stored in memory. This helps the process
to resume from the point where it was
interrupted.
Scheduling Algorithms
Round Robin Scheduling Algorithm
5. The scheduler selects another process
from the ready queue and dispatches it to
the processor for its execution. It is
executed until the time Quantum does
not exceed.
6. The same steps are repeated until all
the process are finished.
Scheduling Algorithms
5. Multilevel Queue Scheduling
• partitions the ready queue into several
separate queues
• The processes are permanently
assigned to one queue, generally based
on some property of the process
Scheduling Algorithms
5. Multilevel Queue Scheduling
Scheduling Algorithms
5. Multilevel Queue Scheduling
• System processes
• Interactive processes
• Interactive editing processes
• Batch processes
• Student processes
Scheduling Algorithms
6. Multilevel Feedback-Queue Scheduling
• processes are permanently assigned to
a queue on entry to the system.
• Processes do not move between
queues.
• This setup has the advantage of low
scheduling overhead, but is inflexible.
Scheduling Algorithms
6. Multilevel Feedback-Queue Scheduling
Scheduling Algorithms
6. Multilevel Feedback-Queue Scheduling
• The number of queues
• The scheduling algorithm for each
queue
• The method used to determine when to
upgrade a process to a higher-priority
queue
Scheduling Algorithms
6. Multilevel Feedback-Queue Scheduling
• The method used to determine when to
demote a process to a- lower-priority
• The method used to determine which
queue a process will enter when that
process needs service
THANK YOU
AND
GOD BLESS!

You might also like