From 859645b3cab2582157481377c0a1b9f18dd04a67 Mon Sep 17 00:00:00 2001 From: Lukas Jiriste Date: Thu, 26 Sep 2024 10:44:04 +0200 Subject: [PATCH] Make odd-numbered philos start 1 ms later This is done for even number of philos to behave orderly. I am no sure whether this counts as interphilo communication though... --- philo/philo.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/philo/philo.c b/philo/philo.c index b8541c8..f0f52fc 100644 --- a/philo/philo.c +++ b/philo/philo.c @@ -82,6 +82,8 @@ void *be_a_philosopher(void *void_philo) { t_philo *const philo = void_philo; + if (philo->id % 2) + usleep(1000); while (!end(philo->settings)) { philo_think(philo); -- 2.30.2