My name is Annika Morgan is this a program that uses a producer and a consumer with a shared buffer. This program also uses semaphores to get into the critical section.
This code contains three files in the C++ programming language. The producer.cpp contains the code for the producer and the the second file consumer.cpp contains the code for the consumer. The last file is the shared.hpp
To run the program you need to comiple it using three commands g++ producer.cpp -pthread -lrt -o producer g++ consumer.cpp -pthread -lrt -o consumer ./producer & ./consumer &
My problems: I was having trouble figuring out the shared memory and learning how to use semaphores to access the critical section.