Skip to content
Closed
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: 5 additions & 1 deletion crates/perry-runtime/src/array/subclass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ fn cached_dense_layout(key: u64) -> Option<DenseSubclassLayout> {
let slots = entry.slots.load(Ordering::Relaxed);
let bounds = entry.bounds.load(Ordering::Relaxed);
// Recheck the seqlock before interpreting either word so readers never
// combine payloads from two colliding publishers.
// combine payloads from two colliding publishers. The fence stops the
// relaxed payload loads above from being reordered past this recheck on
// weakly ordered targets - an Acquire load alone only orders what comes
// after it, not what precedes it in program order.
std::sync::atomic::fence(Ordering::Acquire);
if entry.sequence.load(Ordering::Acquire) != sequence {
return None;
}
Expand Down
Loading