unsynced_bank_withdraw.c - a C program that demonstrates the effect of a race condition using the a bank withdrawal example.
synced_bank_withdraw.c - a C program that solves the issue in the unsynced bank withdraw program.
threads_example.c - a C program showing the use of pthread_create() and pthread_join().
Runnable Linux Commands
The command: gcc -Wall -Wextra -O2 -g -pthread -o program program.c
compiles the C source code located inside the file program.c and links the Pthread library to the executable. See more details here.
The command: . ./.short_prompt
executes code inside a file named .short_prompt and sources it (applies all the changes to the current session.) See more details here.
The command: . ./.long_prompt
executes code inside a file named .long_prompt and sources it (applies all the changes to the current session.) See more details here.