Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Ferry Terminal Synchronization Simulation (OS Project)

About The Project

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.

Key Features

  • 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.

Technologies & Concepts

  • Language: C
  • Core Concepts: Process Synchronization, Multi-threading (pthreads), Concurrency, Mutex, Semaphores.
  • Environment: GCC / MinGW, VS Code (.vscode configured for C/C++ build tasks).

Project Structure

  • 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.

Getting Started

Prerequisites

  • A C compiler (GCC/MinGW).
  • (Optional) Make utility for building the project.

Installation & Execution

  1. Clone the repository:
    git clone [https://github.com/YourUsername/Ferry-OS-Simulation.git](https://github.com/YourUsername/Ferry-OS-Simulation.git)

About

A multi-threaded Ferry Terminal Synchronization Simulation developed in C, demonstrating core OS concepts like mutexes and semaphores.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages