From 1dc4de3236cfb346cfb27faa27e157951264607f Mon Sep 17 00:00:00 2001 From: Hugo LAMY Date: Tue, 1 Feb 2022 18:15:26 +0100 Subject: [PATCH] mise en page pour rendu, et annule philo inversees car pbm 610 200 100 --- philo/Makefile | 3 +- philo/{srcs => }/exec.c | 48 ++++- philo/{srcs => }/generic.c | 0 philo/{srcs => }/init.c | 0 philo/{srcs => }/launch.c | 0 philo/{srcs => }/main.c | 0 philo/{headers => }/philo.h | 0 philo/{headers => }/philo_macro.h | 0 philo/{headers => }/philo_proto.h | 0 philo/{headers => }/philo_struct.h | 0 philo/race.log | 330 +++++++++++++++++++++++++++++ philo/{srcs => }/utils.c | 0 12 files changed, 372 insertions(+), 9 deletions(-) rename philo/{srcs => }/exec.c (52%) rename philo/{srcs => }/generic.c (100%) rename philo/{srcs => }/init.c (100%) rename philo/{srcs => }/launch.c (100%) rename philo/{srcs => }/main.c (100%) rename philo/{headers => }/philo.h (100%) rename philo/{headers => }/philo_macro.h (100%) rename philo/{headers => }/philo_proto.h (100%) rename philo/{headers => }/philo_struct.h (100%) create mode 100644 philo/race.log rename philo/{srcs => }/utils.c (100%) diff --git a/philo/Makefile b/philo/Makefile index 9914864..d21ba96 100644 --- a/philo/Makefile +++ b/philo/Makefile @@ -9,7 +9,7 @@ DIR_SRCS = srcs INCLUDES = -I$(HEADERS_D) -HEADERS_D = ./headers +HEADERS_D = . HEADERS = philo.h \ philo_struct.h \ philo_proto.h \ @@ -45,6 +45,7 @@ $(NAME): $(OBJS) $(CC) $(OBJS) -o $(NAME) $(LIBS) clean: + rm -rf $(OBJS) rm -rf $(DIR_OBJS) fclean: clean diff --git a/philo/srcs/exec.c b/philo/exec.c similarity index 52% rename from philo/srcs/exec.c rename to philo/exec.c index 8ac94e2..883824a 100644 --- a/philo/srcs/exec.c +++ b/philo/exec.c @@ -3,10 +3,10 @@ /* ::: :::::::: */ /* exec.c :+: :+: :+: */ /* +:+ +:+ +:+ */ -/* By: hulamy +#+ +:+ +#+ */ +/* By: hulamy +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ -/* Created: 2022/01/31 10:23:55 by hulamy #+# #+# */ -/* Updated: 2022/01/31 19:31:54 by hulamy ### ########.fr */ +/* Created: 2022/02/01 18:08:58 by hulamy #+# #+# */ +/* Updated: 2022/02/01 18:09:01 by hulamy ### ########.fr */ /* */ /* ************************************************************************** */ @@ -57,9 +57,15 @@ static int eat(t_philo *philo, t_mtx *fork1, t_mtx *fork2) } /* -** offset launch : if (philo->p_nbr % 2 == 0) usleep(10 * 1000); +** + if (philo->p_nbr % 2 == 0) + { + fork1 = &(philo->next->m_fork); + fork2 = &(philo->m_fork); + } + */ void *philo_exec(void *arg) { @@ -72,10 +78,7 @@ void *philo_exec(void *arg) fork1 = &(philo->m_fork); fork2 = &(philo->next->m_fork); if (philo->p_nbr % 2 == 0) - { - fork1 = &(philo->next->m_fork); - fork2 = &(philo->m_fork); - } + usleep(10 * 1000); while (1) { if (eat(philo, fork1, fork2) != 0) @@ -89,3 +92,32 @@ void *philo_exec(void *arg) } return (NULL); } + +/* + 3 610 200 100 . 3 610 200 100 . 3 610 200 200 + . . + -(1) (2)- -(3) . -(1) -(2) -(3) . -(1) (2)- -(3) + . . + . . + . . + 0: +-(1)-+ (2)- +-(3)- . +-(1)-+ -(2) +-(3)- . +-(1)-+ (2)- +-(3)- + | . | . | +100: | (2)- +-(3)- . | -(2) +-(3)- . | (2)- +-(3)- + | . | . | +200: ((|)) (2)- +-(3)-+ . ((|)) +-(2)- +-(3)-+ . ((|)) (2)- +-(3)-+ + | | . | | . | | +300: -(1) (2)- | . -(1) +-(2)- | . | (2)- | + | . | . | | +400: +-(1)-+ -(2)-+ ((|)) . +-(1)- +-(2)-+ ((|)) . +-(1) +-(2)-+ ((|)) + | | . | | . | | +500: | -(2)-+ -(3) . +-(1)- | -(3) . +-(1)- | | + | . | . | | +600: ((|)) +-(2)-+ -(3) . +-(1)-+ ((|)) +-(3)- . +-(1)-+ ((|)) +-(3) + | | . | | . | | +700: +-(1)- | -(3) . | -(2) +-(3)- . | | +-(3)- + | . | . | | +800: +-(1)-+ ((|)) +-(3)- . ((|)) +-(2)- +-(3)-+ . ((|)) +-(2)- +-(3)-+ + | | xxxxxxx . | | . | | +900: | (2)- . -(1) +-(2)- | . | +-(2)- | + +*/ diff --git a/philo/srcs/generic.c b/philo/generic.c similarity index 100% rename from philo/srcs/generic.c rename to philo/generic.c diff --git a/philo/srcs/init.c b/philo/init.c similarity index 100% rename from philo/srcs/init.c rename to philo/init.c diff --git a/philo/srcs/launch.c b/philo/launch.c similarity index 100% rename from philo/srcs/launch.c rename to philo/launch.c diff --git a/philo/srcs/main.c b/philo/main.c similarity index 100% rename from philo/srcs/main.c rename to philo/main.c diff --git a/philo/headers/philo.h b/philo/philo.h similarity index 100% rename from philo/headers/philo.h rename to philo/philo.h diff --git a/philo/headers/philo_macro.h b/philo/philo_macro.h similarity index 100% rename from philo/headers/philo_macro.h rename to philo/philo_macro.h diff --git a/philo/headers/philo_proto.h b/philo/philo_proto.h similarity index 100% rename from philo/headers/philo_proto.h rename to philo/philo_proto.h diff --git a/philo/headers/philo_struct.h b/philo/philo_struct.h similarity index 100% rename from philo/headers/philo_struct.h rename to philo/philo_struct.h diff --git a/philo/race.log b/philo/race.log new file mode 100644 index 0000000..5d0a061 --- /dev/null +++ b/philo/race.log @@ -0,0 +1,330 @@ +==69556== Helgrind, a thread error detector +==69556== Copyright (C) 2007-2017, and GNU GPL'd, by OpenWorks LLP et al. +==69556== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info +==69556== Command: ./philo 3 610 200 100 10 +==69556== +==69556== ---Thread-Announcement------------------------------------------ +==69556== +==69556== Thread #3 was created +==69556== at 0x49AE282: clone (clone.S:71) +==69556== by 0x48712EB: create_thread (createthread.c:101) +==69556== by 0x4872E0F: pthread_create@@GLIBC_2.2.5 (pthread_create.c:817) +==69556== by 0x4842917: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40180E: launch (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011FD: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== +==69556== ---------------------------------------------------------------- +==69556== +==69556== Thread #3: lock order "0x4A812D8 before 0x4A811E8" violated +==69556== +==69556== Observed (incorrect) order is: acquisition of lock at 0x4A811E8 +==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x401B7C: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x4872608: start_thread (pthread_create.c:477) +==69556== by 0x49AE292: clone (clone.S:95) +==69556== +==69556== followed by a later acquisition of lock at 0x4A812D8 +==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x401BE3: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x4872608: start_thread (pthread_create.c:477) +==69556== by 0x49AE292: clone (clone.S:95) +==69556== +==69556== Lock at 0x4A812D8 was first observed +==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Address 0x4a812d8 is 24 bytes inside a block of size 176 alloc'd +==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Block was alloc'd by thread #1 +==69556== +==69556== Lock at 0x4A811E8 was first observed +==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Address 0x4a811e8 is 24 bytes inside a block of size 176 alloc'd +==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Block was alloc'd by thread #1 +==69556== +==69556== +==69556== ---Thread-Announcement------------------------------------------ +==69556== +==69556== Thread #2 was created +==69556== at 0x49AE282: clone (clone.S:71) +==69556== by 0x48712EB: create_thread (createthread.c:101) +==69556== by 0x4872E0F: pthread_create@@GLIBC_2.2.5 (pthread_create.c:817) +==69556== by 0x4842917: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40180E: launch (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011FD: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== +==69556== ---------------------------------------------------------------- +==69556== +==69556== Thread #2: lock order "0x4A811E8 before 0x4A813C8" violated +==69556== +==69556== Observed (incorrect) order is: acquisition of lock at 0x4A813C8 +==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x401B7C: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x4872608: start_thread (pthread_create.c:477) +==69556== by 0x49AE292: clone (clone.S:95) +==69556== +==69556== followed by a later acquisition of lock at 0x4A811E8 +==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x401BE3: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x4872608: start_thread (pthread_create.c:477) +==69556== by 0x49AE292: clone (clone.S:95) +==69556== +==69556== Lock at 0x4A811E8 was first observed +==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Address 0x4a811e8 is 24 bytes inside a block of size 176 alloc'd +==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Block was alloc'd by thread #1 +==69556== +==69556== Lock at 0x4A813C8 was first observed +==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Address 0x4a813c8 is 24 bytes inside a block of size 176 alloc'd +==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Block was alloc'd by thread #1 +==69556== +==69556== +==69556== ---Thread-Announcement------------------------------------------ +==69556== +==69556== Thread #4 was created +==69556== at 0x49AE282: clone (clone.S:71) +==69556== by 0x48712EB: create_thread (createthread.c:101) +==69556== by 0x4872E0F: pthread_create@@GLIBC_2.2.5 (pthread_create.c:817) +==69556== by 0x4842917: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40180E: launch (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011FD: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== +==69556== ---------------------------------------------------------------- +==69556== +==69556== Thread #4: lock order "0x4A813C8 before 0x4A812D8" violated +==69556== +==69556== Observed (incorrect) order is: acquisition of lock at 0x4A812D8 +==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x401B7C: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x4872608: start_thread (pthread_create.c:477) +==69556== by 0x49AE292: clone (clone.S:95) +==69556== +==69556== followed by a later acquisition of lock at 0x4A813C8 +==69556== at 0x483FEDF: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x401BE3: eat (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x401AC3: philo_exec (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4842B1A: ??? (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x4872608: start_thread (pthread_create.c:477) +==69556== by 0x49AE292: clone (clone.S:95) +==69556== +==69556== Lock at 0x4A813C8 was first observed +==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Address 0x4a813c8 is 24 bytes inside a block of size 176 alloc'd +==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Block was alloc'd by thread #1 +==69556== +==69556== Lock at 0x4A812D8 was first observed +==69556== at 0x4843D9D: pthread_mutex_init (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40168D: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Address 0x4a812d8 is 24 bytes inside a block of size 176 alloc'd +==69556== at 0x483C893: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_helgrind-amd64-linux.so) +==69556== by 0x40163C: lst_add_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4015AD: init_chain_philo (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4012ED: init (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== by 0x4011D5: main (in /mnt/nfs/homes/hulamy/42/philo/philosopher/philo/philo) +==69556== Block was alloc'd by thread #1 +==69556== +==69556== +1 3 has taken a fork +11 3 has taken a fork +12 3 is eating +26 2 has taken a fork +215 3 is sleeping +216 1 has taken a fork +217 2 has taken a fork +217 2 is eating +316 3 is thinking +419 3 has taken a fork +419 1 has taken a fork +420 1 is eating +420 2 is sleeping +521 2 is thinking +620 2 has taken a fork +621 1 is sleeping +623 3 has taken a fork +623 3 is eating +721 1 is thinking +824 1 has taken a fork +824 3 is sleeping +825 2 has taken a fork +826 2 is eating +925 3 is thinking +1025 2 is sleeping +1026 3 has taken a fork +1026 1 has taken a fork +1027 1 is eating +1126 2 is thinking +1227 2 has taken a fork +1228 3 has taken a fork +1228 3 is eating +1229 1 is sleeping +1329 1 is thinking +1430 1 has taken a fork +1430 2 has taken a fork +1431 2 is eating +1435 3 is sleeping +1535 3 is thinking +1631 3 has taken a fork +1632 1 has taken a fork +1632 1 is eating +1633 2 is sleeping +1733 2 is thinking +1833 2 has taken a fork +1833 1 is sleeping +1834 3 has taken a fork +1834 3 is eating +1934 1 is thinking +2034 1 has taken a fork +2034 3 is sleeping +2035 2 has taken a fork +2035 2 is eating +2134 3 is thinking +2236 3 has taken a fork +2236 1 has taken a fork +2237 1 is eating +2237 2 is sleeping +2337 2 is thinking +2439 2 has taken a fork +2440 3 has taken a fork +2440 3 is eating +2440 1 is sleeping +2541 1 is thinking +2641 1 has taken a fork +2641 2 has taken a fork +2642 2 is eating +2642 3 is sleeping +2742 3 is thinking +2843 1 has taken a fork +2843 1 is eating +2843 3 has taken a fork +2844 2 is sleeping +2944 2 is thinking +3042 2 has taken a fork +3043 3 has taken a fork +3043 3 is eating +3044 1 is sleeping +3144 1 is thinking +3244 1 has taken a fork +3245 3 is sleeping +3245 2 has taken a fork +3246 2 is eating +3345 3 is thinking +3447 3 has taken a fork +3448 1 has taken a fork +3448 1 is eating +3450 2 is sleeping +3550 2 is thinking +3649 2 has taken a fork +3649 3 has taken a fork +3649 3 is eating +3650 1 is sleeping +3751 1 is thinking +3850 3 is sleeping +3851 2 has taken a fork +3851 2 is eating +3852 1 has taken a fork +3951 3 is thinking +4051 3 has taken a fork +4052 1 has taken a fork +4053 1 is eating +4053 2 is sleeping +4154 2 is thinking +4253 2 has taken a fork +4254 3 has taken a fork +4254 3 is eating +4255 1 is sleeping +4355 1 is thinking +4456 1 has taken a fork +4456 3 is sleeping +4456 2 has taken a fork +4457 2 is eating +4556 3 is thinking +4658 3 has taken a fork +4658 2 is sleeping +4658 1 has taken a fork +4658 1 is eating +4758 2 is thinking +4859 2 has taken a fork +4859 3 has taken a fork +4859 3 is eating +4860 1 is sleeping +4961 1 is thinking +5059 1 has taken a fork +5059 2 has taken a fork +5060 2 is eating +5061 3 is sleeping +5161 3 is thinking +5260 3 has taken a fork +5261 2 is sleeping +5262 1 has taken a fork +5262 1 is eating +5361 2 is thinking +5464 1 is sleeping +5465 3 has taken a fork +5465 3 is eating +5466 2 has taken a fork +5565 1 is thinking +5666 1 has taken a fork +5666 2 has taken a fork +5666 2 is eating +5667 3 is sleeping +==69556== +==69556== Use --history-level=approx or =none to gain increased speed, at +==69556== the cost of reduced accuracy of conflicting-access information +==69556== For lists of detected and suppressed errors, rerun with: -s +==69556== ERROR SUMMARY: 28 errors from 3 contexts (suppressed: 60416 from 121) diff --git a/philo/srcs/utils.c b/philo/utils.c similarity index 100% rename from philo/srcs/utils.c rename to philo/utils.c