Issue
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!
Solution
Maybe you can use the observer pattern.
More info: https://www.baeldung.com/java-observer-pattern
Answered By - Wellington Zomer Nunes Answer Checked By - Marilyn (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.