Add time_to_think to increase survivability trunk
authorLukas Jiriste <ljiriste@student.42prague.com>
Thu, 3 Oct 2024 07:15:55 +0000 (09:15 +0200)
committerLukas Jiriste <ljiriste@student.42prague.com>
Thu, 3 Oct 2024 07:30:30 +0000 (09:30 +0200)
commit592717b4f9dd1ecf083ea0d10769689fbdab3fbf
tree60a1038c64f1f03cb79df224abc246ba82e9586c
parent3798bf87556ea5a095892e3d5af40d4954615c06
Add time_to_think to increase survivability

I thought that the program should be a tool to demonstrate the dangers
in parallel computing. Hence I let the user wholly define what
philosophers can do.
This point of view has however failed me multiple times during
evaluation... This (and a couple of conversations) led me to believe the
only way to pass is to add another element - the time_to_think.

When odd number of philosophers is entered and the time_to_sleep is too
low, the time_to_think is set to such a value that philosophers can
share the forks fairly.
philo/parsing.c
philo/philo.c
philo/philo.h