Skip to content

🍽 Three solutions to the dining philosophers problem in c

Notifications You must be signed in to change notification settings

42-Ikole/philosophers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 

Repository files navigation

philosophers

Three solutions to the dining philosophers problem in c

✅ usage

use

make

and then run with

./philo_one {phil amount} {time to die} {time to eat} {time to sleep} [must eat x amount]

❗ note

  • The must eat amount is optional!
  • All the time variables are in milliseconds.
  • This was made on mac, due to the usage of usleep the values have to be modified for it to work on linux!

💤 code

Philo one:

  • Uses mutex locks and threads.

Philo two:

  • Uses semaphores and threads.

Philo Three:

  • Uses semaphores, threads and processes.

⚠️ bugs

  • This project was written on mac, due to differences in how processes work some usleep values have to be changed in order to make it work on linux!

About

🍽 Three solutions to the dining philosophers problem in c

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published