简体   繁体   English

Java 具有唯一元素的线程安全并发队列

[英]Java thread safe concurrent queue with unique elements

I need a data structure that should be a concurrent and unique queue.我需要一个数据结构,它应该是一个并发且唯一的队列。 ConcurrentLinkedQueue will solve my problem but I need to add unique elements in the queue(FIFO). ConcurrentLinkedQueue将解决我的问题,但我需要在队列中添加唯一元素(FIFO)。 Do I have to combine both Set and ConcurrentLinkedQueue in order to achieve this?我是否必须将SetConcurrentLinkedQueue结合起来才能实现这一点?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM