Skip to content

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.

License

Notifications You must be signed in to change notification settings

MateusjsSilva/philosophers-dinner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

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 file for details.

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Languages