Java BlockingQueue latency high on Linux

后端 未结 4 1872
终归单人心
终归单人心 2021-01-30 23:03

I am using BlockingQueue:s (trying both ArrayBlockingQueue and LinkedBlockingQueue) to pass objects between different threads in an application I’m currently working on. Perform

4条回答
  •  误落风尘
    2021-01-30 23:12

    If latency is critical and you do not require strict FIFO semantics, then you may want to consider JSR-166's LinkedTransferQueue. It enables elimination so that opposing operations can exchange values instead of synchronizing on the queue data structure. This approach helps reduce contention, enables parallel exchanges, and avoids thread sleep/wake-up penalties.

提交回复
热议问题