From: Lukas Jiriste Date: Thu, 26 Sep 2024 08:44:04 +0000 (+0200) Subject: Make odd-numbered philos start 1 ms later X-Git-Url: https://git.ljiriste.work/?a=commitdiff_plain;h=859645b3cab2582157481377c0a1b9f18dd04a67;p=42%2Fphilosophers.git 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... --- 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);