Go Back

A Quick Abstract:

1. Introduction to Non-Preemptive SJF:

Definition:

 Non-Preemptive SJF is a CPU scheduling algorithm that selects the process with the shortest total burst time for execution, without preempting the currently running process.

2. Burst Time and Arrival:

Burst Time:

Each process has an associated burst time, representing the total time it requires on the CPU.

Arrival of Processes:

Processes are added to the ready queue upon arrival.

3. Execution and Process Selection:

Execution:

The process with the shortest burst time is selected for execution.

The selected process runs until completion without interruption.

Completion:

Upon completion, the next process with the shortest burst time is chosen.

4. Waiting Time and Turnaround Time:

Waiting Time:

Waiting time is the cumulative time a process spends in the ready queue.

Turnaround Time:

Turnaround time is the overall time taken by a process from submission to completion.

5. Pros and Cons:

Pros:

Optimizes turnaround time by prioritizing shorter processes.

Minimizes waiting time for processes with shorter burst times.

Cons:

Can lead to "starvation" for longer processes if shorter processes continuously arrive.

6. Starvation:

While Non-Preemptive SJF is efficient for short processes, longer processes may face starvation if a continuous stream of short processes arrives.

7. Example Scenario:

Consider processes A, B, and C with burst times 4, 2, and 8, respectively. In Non-Preemptive SJF, process B would be executed first, followed by A and then C.

8. Conclusion:

In conclusion, Non-Preemptive SJF is a strategy that aims to optimize CPU utilization by prioritizing shorter processes. However, careful consideration is needed to prevent potential starvation for longer processes.

Notes From The Slides:



Shortest-Job-First (SJF) Scheduling

Example of SJF

                                      Process        Burst Time

                             P1                6

                            P2                8

                            P3                7

                            P4                3

Example of Shortest-Job-first

                 Process        Arrival TimeT                Burst Time

                 P1                        0                        8

                 P2                         1                         4

                 P3                        2                        9

                 P4                        3                        5

A green and white squares with black text

Description automatically generated