DSA Studio
Search
Home
Sign in
Go Memory Model Checkpoint
Happens-before, synchronization, and atomic publication.
1. Which operation establishes a happens-before edge by itself in Go?
Writing to a package-level variable
Closing a channel
Reading from an uninitialized channel
Appending to a slice
2. How can you safely publish immutable snapshot state for lock-free reads?
Write to a map field without synchronization
Store a pointer into atomic.Pointer after fully populating it
Use `sync.Pool` as a synchronization mechanism
Rely on `defer` ordering only
3. For lock-free shared state to remain safe, values published through atomic pointers should generally be:
Mutated often by readers
Mutated exactly once
Immutable after publication
Pre-sized and packed
4. What is the memory-model term for an ordering relation that guarantees one event's writes are visible to another?
Submit quiz
Auto-advance on pass
Join Discord
×