Skip to content

Instantly share code, notes, and snippets.

View battila7's full-sized avatar
🍻

Attila Bagossy battila7

🍻
View GitHub Profile
@battila7
battila7 / dining-philosophers.c
Last active March 21, 2018 23:35
Dining Philosophers
#include <pthread.h>
#include <semaphore.h>
#include <stdio.h>
#include <stdlib.h>
const int NUMBER_OF_PHILOSOPHERS = 5;
const int SEMAPHORE_ACROSS_THREADS = 0;
const int FORK_AVAILABLE = 1;