Is there any (unbounded) fair blocking queue in java?

前端 未结 3 1555
醉话见心
醉话见心 2021-01-12 21:33

Is there any implementation of blocking queue which guarantees fair take() operation if multiple consumers are removing element from the same queue. I checked LinkedBlocking

3条回答
  •  悲哀的现实
    2021-01-12 22:08

    Fairness policy may be specified for SynchronousQueue:

    a queue constructed with fairness set to true grants threads access in FIFO order

提交回复
热议问题