Job Scheduler Disk Scheduler Deadlock Paging Concurrency & Race Condition
Kernel Process Input Queue Matrix
Process ID Arrival Time (AT) Burst Time (BT) Action
Active Simulation Core State Viewport Trace: Uninitialized
System Execution Clock T-Tick: 0
ALU CPU Core Pipeline
IDLE
Ready Processes Wait Queue (FIFO Left-to-Right Ordering)
Incremental Trace Gantt Timeline Frame
Academic Exam Solution Worksheet Matrix (Calculates Live at Exit T-Tick)
Process ID Arrival Time (AT) Burst Time (BT) Completion Time (CT) Turnaround Time (TAT) Waiting Time (WT) Response Time (RT)
📝 TAT: CT - AT
📝 WT: TAT - BT
📝 RT: 1st Run - AT
Averages: Waiting...

Tracing State Transitions in CPU Schedulers

A static calculation gives an illusion of simplicity, but an executing operating system operates entirely as a discrete Finite State Machine (FSM). Every single system clock tick changes the global landscape. As the internal system clock advances from tick T to T+1, three high-priority assessments happen simultaneously within the kernel interrupt subsystem:

1. Arrival Evaluation: New processes drop into the matrix, shifting from the New State into the Ready Queue Structure.
2. Preemption Execution Routing: In systems utilizing Preemptive SJF or Round Robin policies, the scheduler compares remaining burst variables or increments quantum tracking timers. If criteria thresholds trip, context switches trigger.
3. State Context Swapping: The context of the running thread is scrubbed from the CPU hardware registers and saved to its Process Control Block (PCB). The scheduler then loads the execution tracking values of the newly assigned thread.

The Distinction: Preemptive SJF vs. SRTF

You will often see the terms Preemptive SJF and Shortest Remaining Time First (SRTF) used interchangeably in computer science. This is because they are exactly the same algorithm.

In a standard (Non-Preemptive) SJF environment, once a process claims the CPU, it cannot be interrupted until it fully completes its burst. However, in the Preemptive SJF architecture, the scheduler continuously evaluates the ready queue every time a new process arrives. If the new arrival requires less execution time than what is remaining on the currently executing process, the CPU is preempted (forcefully taken away) and given to the new, shorter task.