does anyone know of an (open source) implementation of a bounded concrrent cyclic queue , or an available API class built into android/java ?
有没有人知道有限的concrrent循环队列的一个(开源)实现,或者内置到android / java中的可用API类?
the concurrent (not synchronized or lock based) operations i need for this collection are at least enqueue and dequeue , but enqueue can also be enough .
我对此集合所需的并发(非同步或基于锁定)操作至少是入队和出队,但入队也足够了。
for those who are not sure about the collection i need , here's some more info:
对于那些不确定我需要的收藏品的人,这里有更多信息:
- bounded - has max number of items that can be in it .
- 有界 - 具有可以在其中的最大项目数。
- concurrent - allows multiple threads to run operations efficiently without any kind of locking. that's the opposite of synchronized solutions , which only allows a single thread to run operations.
- 并发 - 允许多个线程有效地运行操作,而无需任何类型的锁定。这与同步解决方案相反,后者只允许单个线程运行操作。
- cyclic - if we put items into a filled collection , the new item will replace the oldest item.
- 循环 - 如果我们将项目放入已填充的集合中,则新项目将替换最旧的项目。
please help
请帮忙
1 个解决方案
#1
0
What you describe sounds very much like disruptor, but it's an external library, not built in. As far as I know, there is no built-in ring buffer data structure in Java standard library.
你所描述的听起来非常像disruptor,但它是一个外部库,没有内置。据我所知,Java标准库中没有内置的环形缓冲区数据结构。
#1
0
What you describe sounds very much like disruptor, but it's an external library, not built in. As far as I know, there is no built-in ring buffer data structure in Java standard library.
你所描述的听起来非常像disruptor,但它是一个外部库,没有内置。据我所知,Java标准库中没有内置的环形缓冲区数据结构。