Professional Documents
Culture Documents
CPU Scheduling
• CPU Scheduling is a process of determining which process will own
CPU for execution while another process is on hold.
• The main task of CPU scheduling is to make sure that whenever the CPU
remains idle, the OS at least select one of the processes available in the
ready queue for execution.
• Maximum CPU utilization obtained with multiprogramming
4. Terminates.
• Max throughput
• Min turnaround time
• Min waiting time
• Min response time
Scheduling Criteria
CPU utilization – keep the CPU as busy as possible.
Throughput – # of processes that complete their execution per time unit
Turnaround time – amount of time to execute a particular process
Waiting time – amount of time a process has been waiting in the ready
queue.
Response time – amount of time it takes from when a request was
submitted until the first response is produced, not output (for time-
sharing environment)
Scheduling algorithms
• A Process Scheduler schedules different processes to be assigned to the CPU based
Priority Scheduling
0 24 27 30
0 3 6 30
Each process is assigned a priority. Process with highest priority is to be executed first
and so on.
Processes with same priority are executed on first come first served basis.
Priority can be decided based on memory requirements, time requirements or any other
resource requirement.
Processor Affinity
Load Balancing
Multi-core Processors
running on the same processor but not guaranteeing it will do so, this
processors on which it may run. Some Linux systems implement soft affinity
affinity.
Load Balancing
• Load Balancing is the phenomenon that keeps the
its execution.
Multi-core Processors
• In multi-core processors, multiple processor cores are placed on the same
physical chip. Each core has a register set to maintain its architectural state
and thus appears to the operating system as a separate physical
processor. SMP systems that use multi-core processors are faster and
consume less power than systems in which each processor has its own
physical chip
• Coarse-Grained Multithreading: A thread executes on a processor until a
long latency event such as a memory stall occurs in coarse-grained
multithreading
• Fine-Grained Multithreading: This multithreading switches between
threads at a much finer level, mainly at the boundary of an instruction cycle.
Multiprocessor scheduling symmetrical scheduling
Virtualization and Threading
• In this type of multiple processor scheduling, even a single
CPU system acts as a multiple processor system. In a system
with virtualization, the virtualization presents one or more
virtual CPUs to each of the virtual machines running on the
system. It then schedules the use of physical CPUs among the
virtual machines.