Chapter-3 New
Chapter-3 New
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
CPU Scheduling Algorithms
Basic Concepts
• CPU scheduling is the basis of
multiprogrammed operating systems.
• The objective of multiprogramming is
to have some process running at all
times, to maximize CPU utilization.
CPU Scheduling Algorithms
1. When a process switches from the
running state to the waiting state (for
example, I/O request, or invocation of
wait for the termination of one of the
child processes)
2. When a process switches from the
running state to the ready state (for
example, when an interrupt occurs)
CPU Scheduling Algorithms
3. When a process switches from the
waiting state to the ready state (for
example, completion of I/O)
4. When a process terminates
CPU Scheduling Algorithms
Two main types of CPU Scheduling:
1. Preemptive
2. Non-preemptive
CPU Scheduling Algorithms
Dispatcher
• is the module that gives control of the
CPU to the process selected by the
short-term scheduler.
• Manage actual switching of the CPU
from one process to another.
CPU Scheduling Algorithms
• Switching context
• Switching to user mode
• Jumping to the proper location in
the user program to restart that
program
CPU Scheduling Algorithms
Scheduling Criteria
1. CPU utilization
2. Throughput
3. Turnaround time
4. Waiting time
5. Response time
CPU Scheduling Algorithms
1. CPU Utilization
• Ratio of time the CPU is actively
executing a process to the total time
• May range from 0 – 100 percent
• In real system, it should range 40 – 90
percent.
CPU Scheduling Algorithms
CPU Utilization Formula: