I am trying to model the Bounded-Buffer Problem. My code essentially creates two threads; one reads data from a file into an array and another reads data from the same array into another file. For synchronization purposes, I need to employ semaphores so that "reading" happens only after "writing" has occurred. But I don't have much understanding of semaphores. Am I supposed to write a class that determines how semaphores would behave in my program? Some input and helpful links with examples with definitely help.