ConcurrentLinkedDeque vs LinkedBlockingDeque

后端 未结 4 1629
故里飘歌
故里飘歌 2021-02-07 05:53

I need to have a thread-safe LIFO structure and found that I can use thread-safe implementations of Deque for this. Java 7 has introduced ConcurrentLinkedDeque and

4条回答
  •  忘了有多久
    2021-02-07 06:34

    ConcurentLinkedDequeue is lock-free (see comments in source code) while LinkedBlockingQueue uses locking. That is the former is supposed to be more efficient

提交回复
热议问题