Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/design/specs/Memory-model.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@ The effects of ordinary reads and writes can be reordered as long as that preser
Operations with acquire semantics:
- IL load instructions with `volatile.` prefix when instruction supports such prefix
- `System.Threading.Volatile.Read`
- `System.Thread.VolatileRead`
- `System.Threading.Thread.VolatileRead`
- `System.Threading.Volatile.ReadBarrier` (applies to all prior reads)
- Acquiring a lock (`System.Threading.Monitor.Enter` or entering a synchronized method, applies to all prior reads)

* **Volatile writes** have "release semantics" - the effects of a volatile write will not be observable before effects of all previous, in program order, reads and writes become observable.
Operations with release semantics:
- IL store instructions with `volatile.` prefix when such prefix is supported
- `System.Threading.Volatile.Write`
- `System.Thread.VolatileWrite`
- `System.Threading.Thread.VolatileWrite`
- `System.Threading.Volatile.WriteBarrier` (applies to all following writes)
- Releasing a lock (`System.Threading.Monitor.Exit` or leaving a synchronized method, applies to all following writes)

Expand All @@ -101,7 +101,7 @@ It may be possible for an optimizing compiler to prove that some data is accessi
* **Full-fence operations**
Full-fence operations have "full-fence semantics" - effects of reads and writes must be observable no later or no earlier than a full-fence operation according to their relative program order.
Operations with full-fence semantics:
- `System.Thread.MemoryBarrier`
- `System.Threading.Thread.MemoryBarrier`
- `System.Threading.Interlocked` methods

## C# `volatile` feature
Expand Down
Loading