You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
New scheme for publishing available sequences to consumers in the Multi Producer case:
The availability of a sequence number (slot in the RingBuffer) is now encoded using a single bit instead of an AtomicI32.
The bit encodes whether the associated slot in the RingBuffer was published in an odd or even round (determined by the sequence numbers and how many rounds the RingBuffer has taken given its size).
The scheme reduces memory by 32 times for the data structure for storing the availability (not counting the padding which was also removed but which is CPU-architecture specific).
The performance is the same for single event publication but better for batch publication as
each thread can exploit caching better due to the compressed data structure,
there are fewer writes to atomics and thus
the scheme reduces pressure on store buffers.
The TLA+ model has been updated with this scheme and verified.