#5- CPU SCHEDULING ALGORITHMS
CPU Scheduling Algorithms-- CPU Scheduling algorithms are used by the operating system to determine the order in which processes are executed on the CPU. 1. First come, first served(FCFS): In the FCFS scheduling algorithm, the process that arrives first is executed first. it follows a non-preemptive approach, meaning that once a process starts running, it continues until it completes or voluntarily gives up the CPU. FCFS is simple to understand but may lead to poor utilization of the CPU if long processes arrive before shorter ones. 2. Shortest Job Next(SJN) or Shortest Job First(SJF): SJN or SJF Scheduling selects the process with the shortest total execution time next. it can be either non-preemptive or preemptive. if a new process with a shorter burst time arrives, the currently running process may be preempted. *3. Round Robin(RR): Round Robin is a preemptive scheduling algorithm that assigns a fixed time Quantum (e.g., 12 milliseconds) to each ...