Lecture 5 Flashcards
What is context switching?
In a single‐processor, multi‐processing systems, processes time‐share the CPU resources, called context switching
What is a CPU schedular?
A CPU Schedular (e.g. Short‐term Schedular) fetches processes from Ready‐Queue and allocates
What is the aim of processor scheduling?
Aim is to assign processes to be executed by the processor in a way that meets system objectives, such as response time, throughput, and processor efficiency
What are the 3 different types of processor scheduling?
Long term scheduling
Medium term scheduling
Short term scheduling
What does the Long-term schedular do?
Determines which programs are admitted to the system for processing
Controls the degree of multi-programming
What does the Medium-Term Scheduling do?
Part of the swapping function
• Swapping-in decisions are based on the need to
manage the degree of multi-programming
• Considers the memory requirements of the
swapped-out processes
What does the short-Term Scheduling do?
- Known as the dispatcher
- Executes most frequently
- Makes the fine-grained decision of which process to execute next
What is the short term scheduling criteria for User-oriented?
Response time in an interactive system
Relate to other behaviour of the system as perceived
by the individual user or process
What is the short term scheduling criteria for System-oriented?
Performance: Focus is on effective and efficient utilization of the processor (rate at which processes
are completed)
Minor importance on single-user systems
What is nonpreemptive in Decision mode?
Nonpreemptive
• Once a process is in the running state, it will continue until it terminates or blocks itself for I/O
Name 6 Scheduling algorithms
First-Come-First -Serve(FIFO) Shortest job first PRIOIRTY scheduling Shortest remaining time Round robin Multi queue scheduling
What is Preemptive in Decision mode?
Currently running process may be interrupted and moved to ready state by the OS
What is the First-Come-First-Served (FCFS) algorithm?
FIFO(queue)
The process that has been in the ready queue the longest is selected for running
Some principles of the FCFS Algorithm?
Performs much better for long processes than short ones
Tends to favour processor-bound processes over I/O bound processes
What is the shortest job first Algorithm?
- A short process will jump to the head of the queue
* Possibility of starvation for longer processes
2 Cons of Shortest job first Algorithm?
One difficulty is the need to know, or at least estimate, the required processing time of each process
If the programmer’s estimate is substantially under the actual running time, the system may abort the job
What is the priority Scheduling Algorithm?
Always the process with the highest priority is being executed first
Uses one queue for each priority level.
Cons of Priority Scheduling algorithm?
• Problem: Indefinite blocking or starvation
A PS algorithm can leave some low-priority processes waiting indefinitely
Low priority processes may wait too long to run on lightly loaded time,
In a heavenly loaded system low-priority processes may never run due to system crash.
What is the solution to the problems with Priority scheduling?
Solution: Aging
What is the shortest remaining time first Algorithm?
Scheduler always chooses the process that has the shortest expected remaining processing time
Con of Shortest remaining time first algorithm?
Risk of starvation of longer processes
What is the round robin Algorithm?
Uses preemption based on a clock
• Also known as time slicing because each process is given a slice of time before being preempted
1 advantage of round robin algorithm?
Particularly effective in a general-purpose time-sharing
system or transaction processing system
1 con of Round Robin algorithm
Its relative treatment of processor-bound and I/O-bound processes
What is Rate‐Monotonic Scheduling (RMS) in terms of Real Time Scheduling?
More frequent tasks are given higher priority
What is Earliest Deadline First Scheduling (EDF) in terms of Real Time Scheduling?
Task with earliest deadline gets higher priority
What is traditional UNIX Scheduling?
- Designed to provide good response time for interactive users while ensuring that low-priority background jobs do not starve
- Employs multilevel feedback using round robin within each of the priority queues