Ferry Simulation
Ferry Simulation is a multithreaded ferry transportation simulation developed using Java 17 as a term project for an Operating Systems course. In this system, which transports vehicles between Shores A and B, 30 vehicles (ambulances, cars, minibuses, trucks) and 2 ferries operate simultaneously, each as an independent thread. The project’s technical infrastructure is built on Java synchronization primitives such as Semaphore, ReentrantLock, Condition, and CountDownLatch. Toll booth passages, the FIFO waiting queue, and ferry departure decisions are carefully synchronized; busy-waiting has been completely eliminated. While ambulances always take priority in the queue, the FERRY_MAX_WAIT_TIME parameter also prevents starvation. Notable bonus features added to the project include the `config.properties` file, which allows parameters to be configured at runtime, a live ASCII display panel, and a Swing-based desktop interface. In testing, no deadlocks or race conditions were observed in over 10 runs; all vehicles successfully completed their round trips.