0

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

siledh
  • 3,268
  • 2
  • 16
  • 29
Piotr Müller
  • 5,323
  • 5
  • 55
  • 82
  • 1
    BTW Disruptor is significantly faster than the built in ring buffers if you need higher performance or flexibility. – Peter Lawrey Oct 27 '13 at 20:09
  • 1
    @PeterLawrey +1 but question in this case is about very small proof-of-concept in image manipulation (store last X pixels while iterating) and I just wanted to save some time on cyclic array implementation – Piotr Müller Oct 27 '13 at 21:29

2 Answers2

4

Yes, there is, and it's called ArrayDeque

siledh
  • 3,268
  • 2
  • 16
  • 29
0

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.

Community
  • 1
  • 1
kiruwka
  • 9,250
  • 4
  • 30
  • 41