I put multiple packages in a blocking queue in one thread, and take them out from another thread. The in sequence is 1-2-3, the out sequence becomes 3-2-1. This is NOT a FILO pattern, there is no pattern: it could be 3-1-2, etc.
The question is: can out-of-order issue even take place when put()/take() operations impose on a blocking queue? If it's not possible, which I believe, I'll look elsewhere for the cause. Otherwise, why and how to fix it.
Please provide an [url http://sscce.org]SSCCE that demonstrates this.
Unless you're using a PriorityQueue or some other specialized implementation, it should be a FIFO order. Check the docs for the implementation you're using.
Edited by: jverd on Nov 22, 2011 4:41 PM