https://github.com/pho3nyxx/bartender
A simulation of a classic bar interaction between students and a bartender.
https://github.com/pho3nyxx/bartender
cplusplus operating-system process-management scheduling
Last synced: 3 months ago
JSON representation
A simulation of a classic bar interaction between students and a bartender.
- Host: GitHub
- URL: https://github.com/pho3nyxx/bartender
- Owner: Pho3nyxX
- Created: 2023-03-27T18:52:54.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-12-28T22:53:36.000Z (6 months ago)
- Last Synced: 2025-01-30T17:59:12.128Z (5 months ago)
- Topics: cplusplus, operating-system, process-management, scheduling
- Language: C++
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bartenter
A simulation a classic bar interaction between students and a bartender. Students take from a barrel of beer until that store is empty. Once the store is empty, the bartender is awoken to refill the beer barrel. There are certain restrictions. The barrel can hold up to fifty beers; after taking beer, students drink and think for a random amount of time before going back for more beer; the bartender will awake only three times.
This simulation can only be effectively and efficiently executed using a multithreaded approach. Where multiple student threads run the student functions while a single thread plays the bartender role.
---
## The commands to run the simulation are listed below:
1. Open a terminal window
2. “cd” to the project directory
3. Build command: g++ -pthread Project.cpp –o Project
4. Run command: ./Project
5. Pause command: Enter
6. Resume command: Enter
7. Exit command: Ctrl+c