Concurrent Set Queue

前端 未结 7 1631
情话喂你
情话喂你 2020-12-05 23:10

Maybe this is a silly question, but I cannot seem to find an obvious answer.

I need a concurrent FIFO queue that contains only unique values. Attempting to add a val

相关标签:
7条回答
  • 2020-12-05 23:49

    A java.util.concurrent.ConcurrentLinkedQueue gets you most of the way there.

    Wrap the ConcurrentLinkedQueue with your own class that checks for the uniqueness of an add. Your code has to be thread safe.

    0 讨论(0)
提交回复
热议问题