Piotr Müller
Piotr Müller

Reputation: 5558

Is there non-concurrent (other than ArrayBlockingQueue) standard implementation of cyclic queue?

Is there a standard fast Java queue/circular-buffer structure like ArrayBlockingQueue, backed by an array, but without any concurrency synchronisation overhead?

Upvotes: 0

Views: 554

Answers (2)

kiruwka
kiruwka

Reputation: 9450

If you need fixed-size queue / ring-buffer without synchronization it seems you would need to write it yourself.
You could also use some alternative options such as apache commons CircularFifoBuffer.
Please see more details here.

Upvotes: 0

siledh
siledh

Reputation: 3378

Yes, there is, and it's called ArrayDeque

Upvotes: 4

Related Questions