Image for Shortest Job Next (SJN)

Shortest Job Next (SJN)

Shortest Job Next (SJN) is a scheduling method used in computing to decide which task a processor should work on next. It selects the task with the shortest expected processing time from the waiting queue. By prioritizing smaller tasks, SJN helps reduce overall waiting time and improves system efficiency. However, it requires knowledge of task lengths in advance and can lead to longer tasks being delayed, a problem known as "starvation." Overall, SJN aims to optimize response times and throughput when managing multiple tasks.