Skip to content

First contact with multi-threading in the C language

Notifications You must be signed in to change notification settings

HiImFelipe/threads-c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Threads in C

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.

Running

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

References:

Releases

No releases published

Packages

No packages published

Languages