SynchronousQueue 和 LinkedBlockingQueue比较

java - Implementation of BlockingQueue: What are the differences between SynchronousQueue and Linked

该讨论最佳答案认为:SynchronousQueue 在一个消息生产者和一个消息消费者模式中,在双核情况下,队列中一般只有一个元素时,其吞吐量是LinkedBlockingQueue 和 ArrayBlockingQueue 20倍。

LinkedBlockingQueue只有队列中元素增加时,其吞吐量才赶上,由此可见,SynchronousQueue在只有单个模式下,性能最优。