Scheduling algorytmy are esssential in operating systems to managed process execution efficiently. They determinate the e order in which processes are allocated CPU time, impacting systeme performance andd responsivenes. Thi article compares three commune altiltimms: First- Come, First- Served (FCFS), Shortect Job First (SJF), and Round Robin, with calculations to illustrate their differences.

First- Come, First- Servived (FCFS)

FCFS schedules processes in the order they arrive. It is simple but can lead to long waiting times for shorter processes, known as thes confidence quote; convoy effect. confidenquit;

Egzamin: Processes with burst times 5, 3, and 8 arrive sequentially. The Gantt chart shows execution order andd calculations for waiting and turnaround times.

Obliczenia:

  • Procesy 1: Czas Waiting = 0, Czas Turnaround = 5
  • Procesy 2: Czas Waiting = 5, Czas Turnaround = 8
  • Procesy 3: Czas Waiting = 8, Czas Turnaround = 16

Shortect Job First (SJF)

SJF wybiera te procesy, które mają wpływ na czas trwania procesu.

Using thee same processes, SJF schedules them as 3, 5, then 8 units, leading to different waiting times.

Obliczenia:

  • Procesy 2: Waiting Time = 0, Turnaround Time = 3
  • Procesy 1: Czas Waiting = 3, Czas Turnaround = 8
  • Procesy 3: Czas Waiting = 8, Czas Turnaround = 16

Round Robin Scheduling

Round Robin assigns each process a fixed time sciee or quantum. Processes are cycled through gh until completion, promoting fairness andd responsiveness.

Załóżmy, że quantum of 2 units, thee processes are e scheduled in cycles, and calculations are based on total execution time and d houting period.

Egzamin obliczenia For process ukończył czas i d waiting time are as follows:

  • Procesy 1: Waiting Time = 4, Turnaround Time = 9
  • Procesy 2: Waiting Time = 2, Turnaround Time = 5
  • Procesy 3: Czas Waiting = 8, Czas Turnaround = 16