I am pretty new in writing Java and i'm currently trying to implement a different aspect of the classic "Producer-Consumer" problem. I still use one Producer like usual, who writes strings in a buffer. This buffer is shared with the 2 Consumer threads, and what I am trying to do is to have both the Consumers pick up EVERY string the producer sends, and ONLY then delete the string from the buffer. How can i check if both the Consumer threads have already taken the string??? Thank you!
Maybe you can use the observer pattern.