a semaphore based solution to the producer consumer problem with multiple producers and consumers accessing two buffers