8000 GitHub - sharbel256/concurrent-elevators: Created an elevator controller that ensures that all passengers receive service, minimizing the amount of time it takes to serve all of the passengers, and how much CPU time is used to run the controller.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Created an elevator controller that ensures that all passengers receive service, minimizing the amount of time it takes to serve all of the passengers, and how much CPU time is used to run the controller.

Notifications You must be signed in to change notification settings

sharbel256/concurrent-elevators

Repository files navigation

Concurrent Elevator System

An M story high-rise has N elevators in a single “elevator bank”, each able to serve every floor of the building. Contrary from most elevator designs, there are no buttons to choose a destination floor inside the elevator. Instead, the elevator lobby at each floor has M individual “destination floor” buttons, and P passengers choose their destination by pushing the appropriate button. Once a button is pushed, a display near the buttons tells the passenger which elevator door to wait by. In this assignment, elevators serve only one passenger at a time.

Concurrency info:

  • There is a total of N+P threads.
  • Each elevator has a mutex and a conditional variable.
  • Each passenger has a conditional variable.

1 Elevator, 6 floors, 10 passengers 1 trip each.

one_elevator.mov

4 Elevators, 12 floors, 20 passengers 1 trip each.

four_elevators.mov

About

Created an elevator controller that ensures that all passengers receive service, minimizing the amount of time it takes to serve all of the passengers, and how much CPU time is used to run the controller.

Topics

Resources

Stars

Watchers

Forks

0