Experimenting with the library pthreads, an API available for POSIX (in my case, Linux) ecosystems.
The program consists in having a race condition with a global value such as a bank account balance and making usage of a Mutex to solve it, locking the value and making it consistent throughout all threads.
Requirements:
- GCC compiler;
- POSIX API-compliant OS;
gcc -o program src/main.c src/bank_account/bank_account.c
## program is essentially just the name of the executable and can be changed to whatever
- Mutex Introduction (pthreads)
- Short introduction to threads (pthreads)
- Cap. 18 – Concorrência – 2. Goroutines & WaitGroups - GoLang explanation, helped me to understand what a Mutex is.