All projects

Project case study

SimuKernel

Make operating-system decisions visible

A C#/.NET 8 console simulator for CPU scheduling, page replacement, and process management, with a companion browser scheduling playground.

  • C#
  • .NET 8
  • Operating systems
  • Scheduling
Project notesThree browser scheduling policies, checked against known and generated workloads.

The problem

I built SimuKernel to simulate scheduling and page replacement in C#. The console app includes Round Robin, priority scheduling, multilevel feedback queues with aging, and FIFO, LRU, and optimal page replacement. I also added the browser playground below, where you can edit a workload and compare FCFS, non-preemptive SJF, and Round Robin.

How it fits together

  1. 01

    Arrivals

    Processes become ready at their arrival time.

  2. 02

    Ready queue

    The selected policy chooses the next process.

  3. 03

    CPU

    Run to completion or to the end of a time slice.

  4. 04

    Feedback

    Complete the process or return it to the queue.

The browser model uses one CPU, known CPU-burst lengths, no I/O, and zero context-switch cost. Times are simulation units rather than measurements of your device.

Interactive demo

Scheduling playground

Change the workload, choose a policy, and follow each process through the CPU.

One CPU · no I/O · zero switch cost · simulation time units

Scheduling policy

First come, first served. Each process runs to completion in arrival order.

Editable process arrival times and CPU bursts
ProcessArrivalCPU burstRemove
P1
P2
P3
P4

Use whole numbers: arrival 0–30, CPU burst 1–20, quantum 1–10. Up to 8 processes.

CPU timeline
08121415

P1 from 0 to 8. P2 from 8 to 12. P3 from 12 to 14. P4 from 14 to 15.

P1 running

Results for the complete schedule

Avg. waiting
7.0
Avg. turnaround
10.8
Avg. response
7.0
Per-process results in simulation time units
ProcessFirst runFinishWaitingTurnaround
P10808
P2812711
P312141012
P414151112

Waiting = finish − arrival − burst. Turnaround = finish − arrival. Response = first run − arrival.

Decisions & tradeoffs

First come, first served

Run processes in arrival order without interruption. The rule is predictable, but a long process at the front delays every short process behind it.

Shortest job first

Choose the shortest burst among processes that have arrived, then run it to completion. This often reduces average waiting in a fixed workload, but requires knowing burst lengths and can delay longer jobs.

Round Robin

Give each ready process a bounded turn. A smaller quantum usually improves first response by sharing the CPU sooner; a real scheduler also pays context-switch overhead, which this model leaves out.

Tests and limitations

The playground shows a timeline and per-process results. Waiting time is completion minus arrival minus burst; turnaround is completion minus arrival; response is first start minus arrival.

The browser tests cover known examples, idle periods, simultaneous arrivals, arrivals on a quantum boundary, and invalid input. They also generate 80 workloads for each policy and check that every process gets its requested CPU time without running before arrival. These tests cover the browser engine. The linked C# version has no automated test suite.

Run the console simulator

With the .NET 8 SDK installed, run this command from a repository checkout to open the scheduling and page-replacement menu.

dotnet run --project SimuKernel.csproj

Related writing