Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.36 KB

File metadata and controls

52 lines (36 loc) · 1.36 KB

DeadlockSimulator

A beginner-friendly simulator for operating system deadlock concepts. This project includes a Python Streamlit UI and C++ modules for Banker's Algorithm, deadlock detection, and graph cycle detection.

Features

  • Banker's Algorithm for safe state checking and safe sequence generation
  • Deadlock detection via Resource Allocation Graph (RAG)
  • Directed graph cycle detection using depth-first search
  • Streamlit-based UI for interactive simulation
  • C++ modules compiled to executables for core algorithm logic

Repository Structure

  • app.py - Streamlit application entry point
  • utils.py - Helper functions for input parsing and subprocess management
  • requirements.txt - Python dependencies
  • cpp/ - C++ source files and compile script
  • executables/ - compiled binaries generated by cpp/compile.sh

Prerequisites

  • Python 3.8 or later
  • pip
  • g++ or a compatible C++ compiler
  • Streamlit (pip install streamlit)

Installation

pip install -r requirements.txt

Compile C++ Modules

bash cpp/compile.sh

Run the App

streamlit run app.py

Then open http://localhost:8501 in your browser.

Notes

  • The executables/ folder contains compiled binaries for the C++ algorithms.
  • cpp/compile.sh compiles all C++ source files and places the executables in executables/.