CPU scheduling algorithms

CPU Scheduling Algorithms:

Introduction:

CPU scheduling algorithms decide which process gets to use the CPU and when. They are essential for multitasking and efficient resource management in operating systems.

Types:

  • First-Come, First-Served (FCFS) Processes are executed in the order they arrive. Simple but can cause long waiting times for short tasks.
  • Shortest Job First (SJF) Executes the process with the shortest burst time next. Efficient but can lead to starvation of longer tasks.
  • Round Robin (RR) Each process gets a fixed time slice in rotation. Good for time-sharing systems and fair distribution.
  • Priority Scheduling Processes are assigned priorities. Higher priority processes run first. Can cause starvation of low-priority tasks.
  • Multilevel Queue Scheduling Processes are divided into multiple queues based on type or priority. Each queue has its own scheduling algorithm.
  • Multilevel Feedback Queue Similar to multilevel queue but allows processes to move between queues based on behavior and history.
  • Shortest Remaining Time First (SRTF) Preemptive version of SJF. Always runs the process with the least remaining time.

Use Cases: 

  • Used in operating systems to manage multiple processes 
  • Helps improve CPU utilization and system responsiveness 
  • Ensures fairness and avoids bottlenecks in multitasking environments 
  • Critical for real-time systems, desktops, servers, and mobile devices

Critical (in computing)

  • Something is called critical when it is essential for proper functioning.
  • In real-time systems, critical tasks must be completed on time delays can cause serious problems.
  • Example: In a heart monitor, missing a data update could be life-threatening. That’s a critical task.

Bottleneck (in computing)

  • A bottleneck is a point of congestion that slows down the entire system.
  • It happens when one part of the system can’t keep up with the rest.
  • Example: If the CPU is fast but the disk is slow, the disk becomes a bottleneck and delays everything.

Comments

Popular posts from this blog

FUNCTIONS

Why companies prefer Linux ?

Why companies use Docker?