Week 3 Flashcards
What is a process scheduler (allocates CPU time)?
Allocates CPU time to various processes
What are the 4 Scheduling Algorithms?
First Come First Served (FCFS)
Round Robin (RR)
Shortest Process Next (SPN)
Multilevel Queueing
What is First Come First Served (FCFS)?
Processes get executed in order they arrive
Not interrupted until finishes or reaches a wait state
What are the Pros and Cons of FCFS?
Pros:
Simple and easy to implement
Reduced context switching
Intuitively fair
No starvation
Cons:
Convoy effect - Long waiting time, poor responsiveness
What is Round Robin (RR)?
allocates each task an equal share of the CPU time
What are the pros and cons of RR?
Pros:
Fair CPU Allocation
Responsiveness
No starvation
Cons:
Time quantum sensitivity
Context switch overhead
What is Shortest Process Next (SPN)?
Select the process with the shortest execution time
Non Preemptive - something cannot be taken away or interrupted
What are the pros and cons of SPN?
Pros:
Better average waiting time
Responsiveness
Cons:
Estimating process execution time
May lead to starvation
Longer processes wait longer
What is Multilevel Queueing?
a CPU scheduling algorithm
divides a ready queue into multiple smaller queues
What is Fixed-Priority Scheduling?
High priority queues are executed first
May lead to starvation
What is Time Slicing?
A time slice for each queue
Eg. 60% for interactive, 30% system, 10% batch
What are the pros and cons of Multilevel queueing?
Pros:
Supports different performance objectives
Cons:
Complex and difficult to calibrate
What is a multi core processor?
A multi-core processor has multiple processing units (cores) on a single CPU chip
Each core has its own L1 cache memory
There is a cache hierarchy
What is the common queue?
When a processor becomes available, it chooses a new process from a common queue
What are private queues?
When a processor becomes available, it chooses a new process from its private queue
What are the 2 methods for efficient Multi-Processor Scheduling?
Load Balancing
Processor Affinity
What is Load Balancing?
Evenly distribute processes among CPU cores
Common ready queues automatically enforce load balancing
What is Processor Affinity?
Keep a process on the same CPU core(s)
Soft affinity: only move processes if there is a good reason
Private queues automatically enforce processor affinity
What is The Linux Scheduler?
A multi-queue scheduler
Scheduling domain: a set of CPU cores than can be balanced against each other
Bottom-up Load balancing among domains
Processor affinity - only perform load balancing if there are severe imbalances
What is monoprogramming (single, single)?
Running a single program at a time within a single address space
What is multiprogramming?
allows multiple programs to run simultaneously on a single CPU
basic form of parallel processing
What are the 3 Memory Management Tasks?
Relocation
Protection
Sharing
What is Relocation(hint: new location in m)?
Moving a process to a new location in memory without disrupting its execution
What is Protection?
User processes need to be protected from each other
System processes should be protected from user’s processes