Operating Systems Project
This project was for my Operating Systems class and was develop with a group of three other students. We had to implement a solution to this problem using semaphores:
First, we define our planes to have times of how long they takeoff and fly for. For instance, Airplane 1 has a takeoff time (Runway Time) of 5 seconds and a fly time (Flying Time) of 1 second. Each plane also has how many times it can takeoff before the plane is ground and taken off of the flying queue. This way the program can end. With the runway as our shared resource, we had two threads that deal with the flying planes and landed planes. The thread that deals with flying planes takes the first plane in the flying queue, has it wait for it finish flying, then lands it to inside of the Hanger. Then the thread that deals with landed planes takes over the Runway and has a plane takeoff from the Hanger. This continues until all planes have be grounded and the airport is empty.