Lecture 7: CPU Scheduling P1 Flashcards
Define: CPU-I/O Burst-Cycle
Process execution consists of a cycle of CPU execution and I/O wait time.
When does CPU Scheduling decisions occur?
1) When a process switches from running to waiting state
2) When a process switches from running to ready state
3) When a process terminates
Define Non-preemptive vs preemptive.
Preemptive: process relinquishes CPU voluntarily after time interval before it finishes or until it finishes if the time it takes to finish is shorter than the time interval
Non-preemptive: process relinquishes CPU only after it finishes
Are OS-specific processes (tied to OS services for example) allowed to be preempted?
No
List the Scheduling Evaluation Metrics used to evaluate a scheduling algorithms.
1) CPU Utilization
2) Throughput
3) Turnaround Time
4) Waiting Time
5) Response Time
6) Predictability
7) Faireness
Define: CPU Utilization Metric
Percentage of time the CPU is not idle
Define: Throughput (as a metric for evaluating scheduling algorithms
Completed processes per time unit
Define: Turnaround Time
Submission to completion
Define: Waiting Time
Time spent on the ready queue
Define: Response Time
Response Latency
Define: Predictability
Variance in any of 6 other metrics used to evaluate scheduling algorithms
Define: Fairness
Minimize process starvation
List the Scheduling Algorithms we’ve learned:
1) First Come, First Served (FCFS)
2) Last in, First Out (LIFO)
3) Shortest Job First
4) Round Robin (RR)
5) May use priorities to determine who runs next, (dynamic vs. static algorithms)
6) Multilevel Queueing
7) Multilevel Queueing with Feedback
8) Lottery
Describe First Come, First Served (FCFS)
- The process that requests the CPU first is allocated to the CPU first.
- Can calculate average wait time if you know the time duration of the CPU burst for each process
- shorter processes executing first is better because they can then enter the I/O burst while the next process enters a CPU burst ie. the CPU is never idle. If a long slow process enters CPU burst first, then it will leave for I/O bust, along with the next shorter processes leaving for I/O burst resulting in the CPU sitting idle.
Describe Last In Last Out (LIFO)
- New process are placed at head of ready queue; improves response time for nerdy created processes.
- This may lead to CPU starvation for the early processes