This repo contains a piece of code in C that implements and solves the Dining Philosophers problem using the mutual exclusion property which can be used to control the access to critical sections on concurrent tasks.
Build the asynchronous code using:
gcc -O3 -finline-functions asynchronous.c -pthread -o async
Then run with:
./async
Build the synchronous one using:
gcc -O3 -finline-functions synchronous.c -pthread -o sync
Run with:
./sync