Operating Systems 2nd Unit
Operating Systems 2nd Unit
Trme token Jor emerution: {\ Response Time : In an interactive system, turn-around time is not the best criteria. A ‘process may produce some output fairly early and continue computing new results while previous results are being output to the user. Thus another criteria is the time taken from submission of the process of request until the first response is produced. This measure is called response time. The formula to calculate Response Time = CPU Allocation Time(when the CPU was allocated for the first) — Arrival Time Completion Time : This is the time when the process completes its execution. ) 2 VARIOUS SCHEDULING ALIGORITHMS Preemptive scheduling is used when a process switches from ate or from the waiting state to the ready state.Process Management he average waiting time is much higher than the other algorith 1 : ms, FCFS is very simple and easy to implement and hence not much efficient, lent, qo lean about how to implement this CPU. scheduling detailed article on First come, First serve Scheduling, @ SHORTEST JOB FIRST (SJF) algorithm, please refer to our ‘Ghortest Job First (SIF) is a scheduling process that selec ‘ ts the waiti smallest execution time to execute next. This scheduling crater ey eh with ay not be preemptive. Significantly reduces the average waiting time for other to be executed, The full form of SUF is Shortest Job First) Shortest Job First (SJE) Scheduling Algorithm [______ Provess PI gets executed second a a ithas the burst time of 6 Which js Process P2 gt larger than PS but shorter than P2_ Bas the large bors tne of which and? is larger than Pa, PI and 3 Processes waiting Therefore Waiting time (P2)=9 Therefore Waiting = ing time (2) -9 EES oa Sa se 7a olen unisigonpmne es ‘ se eapis eens { Process PS gets executed third a it hat the Dust ime of 7 whichis Process PA gets executed first as it thas the shortest burst time of 3 Target than PA and PL ‘Therefore Waiting time (P3) =9 ‘Therefore Waiting time (P1) = 0 a6 FIG 2.14: eae of SUF : ¢ Shortest Job first has the advantage of having a minimum average waiting time among all operating system scheduling algorithms. * It is associated with each task as a unit of time to complete. * It may cause starvation if shorter processes keep coming. This problem can be ived using the concept of ageing. antages of Shortest Job First : es the average waiting time thus, it is better than the first come first g algorithm. sed for long term schedulingjarvation © One of the demerit SUF has Is st cated to predict the length of the upcoming Ch * Many times it becomes compli request g algorithm, please refer to oy To learn about how to implement this CPU gchedulin: detailed article on Shortest Job First. PRIORITY SCHEDULING os ie Prédmptive Priority CPU Scheduling Algorithm is a pre emptive method of Cp, scheduling algorithm that works based on the priority of neem In this algorithy, he most important prog tions to be as important, meaning that # m Seen Mies hat is, where there are more than oy, flict, st be done first, In the ease of any conflict, n the most important CPU planning algorithm works o First Serve) algorithm) mu! processor with equal value, the! the basis of the FCFS (First Come ‘aracteristics of Priority Scheduling : * Schedules tasks based on priority. © When the higher priority work arrives while a task with less priority is execute the higher priority work takes the place of the less priority one and « The latter is suspended until the execution is complete. Lower is the number assigned, higher is the priority level of a process. Gece of Priority Scheduling = © The average waiting time is less than FCFS * Less complex _DGadvantages of Priority Scheduling : * One of the most common demerits of the Preemptive priority CPU scheduling algorithm is the Starvation Problem. This is the problem in which a process has to wait for a longer amount of time to get scheduled into the CPU. This condition s_ called the starvation problem. bE 2.79.4 ROUND ROBIN Round Robin is a CPU scheduling algorithm where each process is cyclically assigned k ies time slot. It is the preemptive version of First come First Serve CPU Scheduling — algorithm. Round Robin CPU Algorithm generally focuses on Time Sharing technique)