An open API service indexing awesome lists of open source software.

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.

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.