Concurrent writers should only rely on what they receive from the writer. Closes #2.
diff --git a/benchmark-disruptor/shared_writer_contended_write_test.go b/benchmark-disruptor/shared_writer_contended_write_test.go
index 4632366..8a48b60 100644
--- a/benchmark-disruptor/shared_writer_contended_write_test.go
+++ b/benchmark-disruptor/shared_writer_contended_write_test.go
@@ -62,7 +62,7 @@
b.ResetTimer()
go func() {
- previous, current := disruptor.InitialSequenceValue, disruptor.InitialSequenceValue
+ current := disruptor.InitialSequenceValue
for current < iterations {
current = writer.Reserve(ReserveMany)
@@ -71,10 +71,9 @@
}
writer.Commit(previous+1, current)
- previous = current
}
}()
- previous, current := disruptor.InitialSequenceValue, disruptor.InitialSequenceValue
+ current := disruptor.InitialSequenceValue
for current < iterations {
current = writer.Reserve(ReserveMany)
@@ -83,7 +82,6 @@
}
writer.Commit(previous+1, current)
- previous = current
}
b.StopTimer()