Skip to content

Unsynchronized data races #189

@wingo

Description

@wingo

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?

  1. Will a thread reading memory being concurrently filled via memory.fill see a linearly advancing fill?
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions