Scenario: My producer fills an array, say, the capacity of new int [10], before my consumer gets a chance to consume any. My manufacturer sees that the array is full and blocked.
Then my consumer comes and removes int [0] and signals to the manufacturer that the array now has an empty slot to fill.
My producer wakes up and tries to add a new element to the array. Given that only int [0] is free, and we implement FIFO, does ArrayBlockingQueue shuffle the remaining 9 elements to the left, filling in 0-8 indices and leaving int [9] free for the manufacturer?
I looked at the implementation, but do not see the copy function of the array,
source share