The updated exam includes a bonus using processes and semaphores (not threads/mutexes). The bonus executable is called philo_bonus and must handle forks as semaphores with a single process per philosopher.
The updated exam gives you 4 hours. Do not waste time. Follow this battle plan: 42 exam rank 03 updated
git clone https://github.com/JCluzet/42_EXAM.git
cd 42_EXAM
make
./42_EXAM
Choose “Rank 03” → it will give you the exact subject and run the updated grader. The updated exam includes a bonus using processes
In Rank 02, you could sometimes get away with not allocating memory. In Rank 03 exams, if you don't allocate, you fail. Choose “Rank 03” → it will give you
This is the flagship project for Rank 03. In the updated curriculum, ft_printf is often the first major hurdle.
The most common failure in the updated exam is off-by-one in death timing. Use gettimeofday() (or preferably clock_gettime(CLOCK_MONOTONIC) for precision). Store last_meal_time per philosopher. The monitor thread must check:
if (current_time - philo->last_meal_time > philo->data->time_to_die)
print_death(philo);
Do not check only after usleep; use a separate monitor thread or loop.