On Mon, Jan 23, 2023 at 12:42 AM robert engels <reng...@ix.netcom.com> wrote:
> Write data to memory mapped file/shared memory. Keep track of last written > byte as new_length; > > Use atomic.StoreUint64(pointer to header.length, new_length); > > This does not answer the question I posed, which boils down to: How does one insert the equivalent of smp_wmb() / asm volatile("" ::: "memory") into a go program. For instance is any of these an answer? https://groups.google.com/g/golang-nuts/c/tnr0T_7tyDk/m/9T2BOvCkAQAJ > readers read ... > Please don't focus on the reader ;) > This assumes you are always appending ,,, then it is much more complicated > ... all readers have consumed the data before the writer reuses it. > Yes, it is much more complicated :) I am making a note to post the result back to this thread in a few weeks when it is readable enough. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAMrvTS%2BLF%3D9%3DsyiOyZSsxpdcEuKonGN14HEdS89OQNJ_%2BJTCUQ%40mail.gmail.com.