In operating systems, various scheduling algorithms are used to manage the allocation of CPU time to processes or threads. The choice of scheduling algorithm depends on the system's goals and requirements. Here are some commonly used scheduling algorithms and a brief description of each:
-
First-Come, First-Served (FCFS):
- Description: The FCFS algorithm schedules processes in the order they arrive in the ready queue. It's a non-preemptive algorithm, meaning once a process starts executing, it continues until it completes.
-
Shortest Job First (SJF):
- Description: SJF scheduling selects the process with the shortest expected execution time next. It can be either preemptive (selects the shortest remaining time) or non-preemptive (waits for the current process to finish).
-
Round Robin (RR):
- Description: RR scheduling assigns a fixed time slice (quantum) to each process in a circular order. It ensures fair access to the CPU for all processes and is commonly used in time-sharing systems.
-
Priority Scheduling:
- Description: Priority scheduling assigns priorities to processes, and the process with the highest priority gets access to the CPU. It can be preemptive or non-preemptive.
-
Multilevel Queue Scheduling:
- Description: Multilevel queue scheduling divides processes into multiple queues, each with its own scheduling algorithm. Processes move between queues based on their characteristics.
-
Multilevel Feedback Queue Scheduling:
- Description: This is an extension of multilevel queue scheduling. Processes can move between queues dynamically based on their behavior and execution history.
-
Rate-Monotonic Scheduling (RMS):
- Description: RMS is used in real-time operating systems. It assigns priorities to tasks based on their periodicity, with shorter periods receiving higher priority.
-
Earliest Deadline First (EDF):
- Description: EDF scheduling assigns priorities based on the deadline of tasks. The task with the earliest deadline gets the highest priority. It is commonly used in soft real-time systems.
-
Priority Inheritance Protocol (PIP):
- Description: PIP is used to avoid priority inversion in real-time systems. It temporarily boosts the priority of a lower-priority task to prevent it from blocking a higher-priority task.
-
Fair Share Scheduling:
- Description: Fair share scheduling ensures that each user or group gets a fair share of CPU time. It is often used in multi-user and multi-tasking environments.
-
Weighted Round Robin (WRR):
- Description: WRR scheduling assigns weights to processes, allowing some processes to receive more CPU time than others in a round-robin fashion.
-
Linux Completely Fair Scheduler (CFS):
- Description: CFS is used in the Linux kernel and aims to provide fair and efficient CPU scheduling by maintaining a red-black tree of processes based on their runtime.
-
Windows Priority-Based Scheduling:
- Description: Windows uses a priority-based scheduling algorithm, where threads and processes have dynamic priorities that are adjusted based on their behavior.
IF HELPFUL THEN UPVOTE