Table of Contents
CPU plánování algoritmy determine how processes are assigned to the CPU, affecting system performance and responveness. Understanding their practical calculations helps in selectin that e approvate algoritm for specific consultos.
Types of CPU Scheduling Algorithms
Common algoritmy include First-Come, First-Servek (FCFS), Shortett Job Next (SJN), Round Robin (RR), and Priority Scheduling. Each has different methods for selecting thae next process to execute.
Propertance Metrics
Key metrics for evaluating scheduling algoritmy are waithms time. turnaroud time, and CPU utilization. Kalkulations of ten impeve process burst times and arrival times.
Practical Calculation Example
Consider three processes with burst times of 5, 3, and 8 units arriving at time 0. Using FCFS, thee total waiting time is calculated by summing thee idle times between een processes.
FCFS:
- Process 1: waits 0 units
- Process 2: čeká 5 units
- Process 3: čeká 8 units
Total waiting time = 0 + 5 + 8 = 13 units. Average waiting time = 13 / 3 doposud 4.33 units.
Obchodní-offs in Scheduling
Different algoritms balance fairness, accessiency, and response time. For exampla, Round Robin improvises responveness but may increase context switching overhead. Priority scheduling can lead to starvation if not management descripled approwly.