David Howells is a software engineer who has contributed technical documentation for the Linux kernel. With Paul E. McKenney, he authored a guide to circular buffers, including the interaction between index arithmetic and synchronization.[ref]
Circular Buffers by David Howells and Paul E. McKenney. Author byline and opening summary
Their example separates the producer's insertion index from the consumer's removal index. With one producer and one consumer, memory barriers publish initialized data before an index advertises it as available. This illustrates why a correct data structure needs both an indexing convention and an account of what concurrent operations can observe.[ref]
Circular Buffers by David Howells and Paul E. McKenney. Using memory barriers with circular buffers, The producer and The Consumer
New to topics? Read the docs here!