Blocking Queue Take out of Order
问题 I have a simple blocking queue containing Integers. In a multi thread environment I am taking and adding elements to the the back of the queue. BlockingQueue<Integer> test = new LinkedBlockingQueue<Integer>(); The goal is to have adding in order.. and taking be in the same order as well. On the 5th line of my program output, 3 is somehow at the front of the queue before 2 is, despite it appearing that 2 was added first. All of these were added in a single threaded environment, so I know the