https://github.com/mateusjssilva/philosophers-dinner
A C program simulating the "Dining Philosophers" problem using threads and mutexes to manage resource sharing and prevent deadlock. Each philosopher is a thread, and mutexes represent chopsticks, ensuring safe concurrent access.
https://github.com/mateusjssilva/philosophers-dinner
c mutex operating-system philosophers-dinner-problem synchronization theads
Last synced: about 1 year ago
JSON representation
A C program simulating the "Dining Philosophers" problem using threads and mutexes to manage resource sharing and prevent deadlock. Each philosopher is a thread, and mutexes represent chopsticks, ensuring safe concurrent access.
- Host: GitHub
- URL: https://github.com/mateusjssilva/philosophers-dinner
- Owner: MateusjsSilva
- License: mit
- Created: 2023-04-28T12:13:34.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-09-15T15:15:16.000Z (almost 2 years ago)
- Last Synced: 2025-02-05T09:54:01.190Z (over 1 year ago)
- Topics: c, mutex, operating-system, philosophers-dinner-problem, synchronization, theads
- Language: C
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# philosophers dinner
This is a C program that simulates the classic "Philosophers' Dinner" problem using threads and mutexes. The code implements the solution to avoid deadlock and the deadlock condition, using mutexes to represent the chopsticks and a shared variable to indicate which philosophers are currently eating.
## Contribution
Feel free to open issues or submit pull requests. All contributions are welcome!
## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.