I am using PriorityBlockingQueue
with a priority field. In my test, I use System#currentTime()
for priorities - the same priorities are obtained on the computer so fast that the milliseconds are the same (or more like milliseconds on a PC with a valid margin of error).
When the priorities are the same, the queue works as if its stack, which seems strange. Is there an alternative to the fact that the queue works as if it were a normal queue (i.e., FIFO, not LIFO behavior) when the priorities of the elements are the same?
source share