memory.fill is currently specified as writing its bytes sequentially from lowest address to highest: https://webassembly.github.io/spec/core/exec/instructions.html#xref-syntax-instructions-syntax-instr-memory-mathsf-memory-fill. This behavior is unobservable to the thread executing the instruction, and I would presume most implementations don't write a byte at a time. But with multiple threads, I understand the goal is to allow races. What do we guarantee in that case?
- Will a thread reading memory being concurrently filled via
memory.fill see a linearly advancing fill?
- Will a thread reading memory being concurrently filled via
memory.fill see either the old data or the new data? Could it see something else?
I am particularly interested in the last question: is seeing something else allowed.
memory.fillis currently specified as writing its bytes sequentially from lowest address to highest: https://webassembly.github.io/spec/core/exec/instructions.html#xref-syntax-instructions-syntax-instr-memory-mathsf-memory-fill. This behavior is unobservable to the thread executing the instruction, and I would presume most implementations don't write a byte at a time. But with multiple threads, I understand the goal is to allow races. What do we guarantee in that case?memory.fillsee a linearly advancing fill?memory.fillsee either the old data or the new data? Could it see something else?I am particularly interested in the last question: is seeing something else allowed.