Hello =) I am trying to come up with a pseudocode for the following problem, but I'm a bit confused with the semaphores' sychronization, so I hope someone can help!
We have M consumers and M producers and 2 buffers of the same N size. The consumers consume from one buffer, and the producers produce on the other buffer. When the consumer buffer is empty and the producer buffer is full, the buffers swap and the processes continue.
Any ideas on how to sychronize those processes using semaphores? Thank you!