add readme and update makefile

This commit is contained in:
stitchy 2023-11-29 20:48:53 +00:00
parent 9aa7973d2f
commit 2c867d2bea
Signed by: stitchy
SSH key fingerprint: SHA256:yz2SoxdnY67tfY5Jzb0f2v8f5W3o/IF359kbcquWip8
2 changed files with 42 additions and 1 deletions

View file

@ -2,7 +2,7 @@ CC=gcc --std=gnu99 -g
output=myCounter
all: main.c main.h
$(CC) main.c -o $(output)
$(CC) main.c -lpthread -o $(output)
clean:
rm -fr *.o vgcore.* $(output)

41
threads/readme.md Normal file
View file

@ -0,0 +1,41 @@
# myCounter
My Counter is an implementation of a threaded producer consumer architecture.
In this implementation, the producer (main thread) increments the counter and
the consumer (spawned thread) prints out the changes to myCount. Some status
updates about the locking, waiting, and signaling of threads and mutexes are
printed to the output as well.
## Compiling
You can compile this program by using the make command or by hand.
Simply type:
```
make
```
or, to manually compile, type:
```
gcc -std=c99 main.c -lpthread -o myCounter
```
## Running
To run, type:
```
make run
```
or
```
./myCounter
```
to run manually