Hi Kim, On 04/09/2024 12:50, 김민주 wrote:
In the original approach, I intended for each thread to call |put|, confirm that it has entered the waiting state, and then allow the next thread to put the next sequence value and also enter the waiting state. This approach was designed to simulate a situation where the queue is already full and each thread has to wait in line for space to become available.
The problem with that is that you would still need to ensure that each thread calls `put` in order, and for that, you would still need external synchronization. I am not an expert in java.util.concurrent, but it feels like the fix you had in mind would not buy you much. best regards, -- daniel