A C++ console-based simulation of an Air Traffic Control System that demonstrates multithreading, thread-safe queues, and synchronization using std::mutex
and std::condition_variable
.
This project simulates multiple aircraft requests (landing and takeoff) and manages them using a thread-safe queue system.
It highlights concurrency in C++ with proper synchronization and logging.
- 🛬 Handles multiple aircraft requests (landing & takeoff)
- 🧵 Implements real multithreading using
std::thread
- 🛫 Thread-safe runway management with
mutex
&condition_variable
- 🗂️ Queue system for scheduling aircrafts
- 📝 Logs all operations to a file (
log.txt
)
AirTrafficControlSimulation/
├── main.cpp # Entry point
├── Aircraft.h/.cpp # Aircraft class with simulation logic
├── RunwayManager.h/.cpp # Handles aircraft queue & processing
├── Logger.h/.cpp # Thread-safe logging system
└── log.txt # Output log file
Use g++ with pthread support:
g++ main.cpp Aircraft.cpp RunwayManager.cpp Logger.cpp -o AirTrafficSim -pthread ./AirTrafficSim
Aircraft AC1001 requested landing.
Runway cleared for aircraft AC1001 (landing)
Aircraft AC1001 has landed.
Contributions and improvements are welcome! Feel free to fork this repository and submit pull requests.
If you like this project, don’t forget to star ⭐ the repo!