The Conductor does this as part of its duty cycle.

For Publications (Network and IPC), the Conductor component will be
cleaning incrementally as part of updating flow control position.

https://github.com/real-logic/Aeron/blob/master/aeron-driver/src/main/java/io/aeron/driver/NetworkPublication.java#L538
https://github.com/real-logic/Aeron/blob/master/aeron-driver/src/main/java/io/aeron/driver/IpcPublication.java#L186

For Images, the Conductor also does it, but part of the loss detection and
rebuild.

https://github.com/real-logic/Aeron/blob/master/aeron-driver/src/main/java/io/aeron/driver/PublicationImage.java#L754

Flow control and windowing prevents overrunning the cleaning position.

-- Todd

On Sun, May 28, 2017 at 8:17 PM, Peter Veentjer <[email protected]>
wrote:

> In Martin Thompson's talks about Aeron he mentions writing threads doing
> an increment on an AtomicLong counter to claim a region in a buffer, but
> the initial 4 bytes  for the length field aren't written, but only on
> completion of the frame, the length is set. This signals to the reader of
> the buffer that this particular write is complete and provides a happens
> before relation.
>
> My question is about this length field; who is responsible for zero'ing it
> out? Once the buffer has been written, the content could be total gibberish
> and if it isn't zero'd, the reading thread could falsely assume it is
> written and boom..
>
> --
> You received this message because you are subscribed to the Google Groups
> "mechanical-sympathy" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"mechanical-sympathy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to