A C# / .NET project demonstrating two core operating systems concepts — multi-threading with synchronization and inter-process communication (IPC) — through practical, scenario-based implementations built and tested independently.
Simulates a restaurant reservation system where multiple threads compete for shared resources. Demonstrates:
- Concurrent thread execution — multiple threads performing simultaneous operations
- Mutex-based resource protection — preventing race conditions on shared reservation data
- Deadlock creation — intentionally inducing a deadlock to illustrate the conditions under which they occur
- Deadlock resolution — implementing strategies to detect and recover from deadlocked states
Implements a producer-consumer communication pattern between two separate processes using named pipes:
- Producer process — writes messages to a named pipe
- Consumer process — reads and processes messages from the pipe
- Demonstrates how independent processes communicate without shared memory
- Thread lifecycle management and synchronization primitives (mutexes)
- The four necessary conditions for deadlock and how to break them
- IPC via named pipes as an alternative to shared memory
- Unit testing concurrent systems in .NET (
ProjectATests,ProjectBTests)
- Language: C#
- Platform: .NET 8.0
- IDE: Visual Studio / VS Code
- OS: Linux (Ubuntu via WSL) recommended
-
WSL (Windows Subsystem for Linux) — open PowerShell and run:
wsl --installRestart when prompted.
-
Ubuntu — available on the Microsoft Store (easiest Linux environment for WSL).
-
Install .NET SDK 8.0 — in your Ubuntu terminal:
sudo apt update sudo apt install -y wget apt-transport-https wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb sudo dpkg -i packages-microsoft-prod.deb sudo apt update sudo apt install -y dotnet-sdk-8.0
-
Install Git:
sudo apt install -y git
git clone https://github.com/JonahGardin48/OS-Multi-Threading-and-IPC.git
cd OS-Multi-Threading-and-IPCRun Project A (Multi-Threading):
cd ProjectA
dotnet build
dotnet runRun Project B (IPC):
cd ProjectB
dotnet build
dotnet runTest Project A:
cd ProjectATests
dotnet build
dotnet testTest Project B:
cd ProjectBTests
dotnet build
dotnet test