diff --git a/threads/makefile b/threads/makefile index 6a2a24a..35f83e4 100644 --- a/threads/makefile +++ b/threads/makefile @@ -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) diff --git a/threads/readme.md b/threads/readme.md new file mode 100644 index 0000000..204570b --- /dev/null +++ b/threads/readme.md @@ -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