Projects · University

Emergency Department simulation

Stable 2025 – 2026 Author

A hospital emergency department where every role is a separate process, coordinating purely through POSIX message queues, shared memory, semaphores and signals.

1 photo

  • Process diagram of the simulation
    Process diagram of the simulation

My final project for the operating systems course. The master process spawns and reaps registration windows, triage, doctors, a dispatcher and one process per patient (children are threads of their guardian's process), and all of them talk only through IPC.

  • Queues that sort themselves. Message-queue priorities encode VIP status and triage colour, so patients are ordered by the kernel, not by application code.
  • A single writer for the per-patient control registry in shared memory (the dispatcher), which keeps the concurrency story simple and checkable.
  • An interactive console while the simulation runs: add patients in bursts or on a timer, add or send home doctors, send the director's signals, or evacuate the building with SIGUSR2.
  • Clean shutdown on Ctrl-C, a clean-ipc target for runs killed with SIGKILL, and tools to dump the shared state of a running simulation.