Abstract
The producer-consumer term refers to a programming concept in which the producer computes some value and then place it in a shared object. The consumer reads the produced value and does something with it. How do we make sure that the consumer doesn't consume the value until it has been produced? Or, what happens if the producer and consumer work simultaneously? As synchronizing them could be done inside operating systems, still difficult using programming languages. This paper puts the mechanism for synchronizing both the producer and consumer in a programming language taking in account that the pc used has only one cpu. Java has been used to get rid of that difficulty and synchronize them as it is considered as the first concurrent object oriented language COOP.