This project is an Operating Systems simulation developed in C. It models a complex synchronization and concurrency scenario at a ferry terminal. The simulation handles the arrival, toll processing, queueing, and boarding of various vehicle types (Cars, Minibuses, and Trucks) onto a ferry. It heavily utilizes OS concepts such as multi-threading, mutexes, and semaphores to prevent race conditions and ensure safe resource allocation during the boarding process.
- Multi-threaded Vehicle Generation: Vehicles (
car,minibus,truck) are simulated as concurrent threads. - Toll Management (
toll.c): Synchronized payment and processing gates. - Queue & Area Management (
square.c,behind_square.c): Dynamic memory and space management for vehicles waiting to board. - Ferry Operations (
ferry.c): Capacity calculation and synchronized loading/unloading sequences.
- Language: C
- Core Concepts: Process Synchronization, Multi-threading (pthreads), Concurrency, Mutex, Semaphores.
- Environment: GCC / MinGW, VS Code (
.vscodeconfigured for C/C++ build tasks).
include/: Header files containing definitions and structures (vehicle.h,ferry.h,toll.h, etc.).src/: Source code implementations for each simulation module.build/: Compiled executables (simulation.exe,main.exe).OS_report.pdf: Detailed theoretical report and project documentation.
- A C compiler (GCC/MinGW).
- (Optional) Make utility for building the project.
- Clone the repository:
git clone [https://github.com/YourUsername/Ferry-OS-Simulation.git](https://github.com/YourUsername/Ferry-OS-Simulation.git)