Indicate which is a pre-emptive scheduling algorithm A. Round-robin B. Shortest-job-next C. Priority-based D. All of the above E. None of the above

[amp_mcq option1=”Round-robin” option2=”Shortest-job-next” option3=”Priority-based” option4=”All of the above E. None of the above” correct=”option2″]

The correct answer is: B. Shortest-job-next

A pre-emptive scheduling algorithm is a scheduling algorithm that allows the operating system to interrupt a running process and switch to another process. This is in contrast to a non-preemptive scheduling algorithm, in which a process must run to completion before the operating system can switch to another process.

Shortest-job-next is a pre-emptive scheduling algorithm that schedules the process with the shortest remaining execution time. This algorithm is fair, as all processes have an equal chance of being scheduled, and it is efficient, as it minimizes the average waiting time of processes.

Round-robin is a non-preemptive scheduling algorithm that schedules processes in a round-robin fashion. Each process is given a time slice to run, and then the operating system switches to the next process in the queue. This algorithm is simple to implement, but it is not fair, as processes with longer execution times may have to wait longer to run.

Priority-based scheduling is a pre-emptive scheduling algorithm that schedules processes based on their priority. Processes with higher priorities are scheduled before processes with lower priorities. This algorithm is fair, as all processes have an equal chance of being scheduled, but it is not efficient, as processes with high priorities may monopolize the CPU.

Therefore, the correct answer is B. Shortest-job-next.

Exit mobile version