41 lines
640 B
Markdown
41 lines
640 B
Markdown
|
|
# 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
|