private void doRun() { var batchEventProcessor = ringBuffer.createHandler(new SimpleEventHandler()); Thread t = new Thread(() => { long iterations = Constants.ITERATIONS; for (long l = 0; l < iterations; l++) { SimpleEvent e = new SimpleEvent(l, l, l, l); ringBuffer.put(e); while (batchEventProcessor.Sequence.Value != iterations - 1) { // LockSupport.parkNanos(1); } } }); t.Start(); batchEventProcessor.Halt(); t.Join(); }