I'm working on a project that utilizes producers and consumers for an operating systems class. Each producer and each consumer will be its own thread. The producers will generate records that will be stored in a global buffer, in which the consumer will then access to use the data. I am having a hard time figuring out how to use actual pthreads. My original plan was to create a Producer class and a Consumer class and simulate the threads, but we are told now not to do so. Is there a c++ class for this? Also, for the buffer, I was initially creating an array of structs (the struct being the record created by the producer), but was now told I need to actually use Buffer. Are there any basic tutorials for this out there, or can someone shed some light on this topic on a good place to start.
Any help is appreciated :)