tgrekov-philosophers
HIVE philosophers July 2024
|
Definition in file seat.c.
Go to the source code of this file.
Functions | |
int | setup (t_global *global, t_thread **thread) |
Allocate fork array and thread structure, initialize mutexes. | |
void * | breakfast (void *data) |
Ponder, eat, sleep, repeat. | |
static void | monitor_eat_quota (t_global *global, t_thread *thread, int i) |
End simulation once all philos are full. | |
static int | create_threads (t_global *global, t_thread *thread) |
Spawn philos and wait for them to complete. | |
int | seat (t_opt opt) |
Allocate for, initialize, seat, wait on (pun intended), and free all philos. | |
void * breakfast | ( | void * | arg | ) |
Ponder, eat, sleep, repeat.
arg |
void* |
Definition at line 65 of file breakfast.c.
References eat(), philo_sleep(), status(), and stop().
Spawn philos and wait for them to complete.
global | |
thread |
int |
Definition at line 54 of file seat.c.
References breakfast(), err(), and monitor_eat_quota().
int seat | ( | t_opt | opt | ) |
Allocate for, initialize, seat, wait on (pun intended), and free all philos.
opt |
int |
Definition at line 90 of file seat.c.
References create_threads(), and setup().
Allocate fork array and thread structure, initialize mutexes.
global | |
thread |
int |
Definition at line 84 of file setup.c.
References allocate(), and initialize().