From 40b06fef66dfe5fe356684eb5f2727b47e999bcf Mon Sep 17 00:00:00 2001 From: SabrinaJewson Date: Sun, 28 Aug 2022 20:43:24 +0100 Subject: [PATCH] Add note about duplication of `1` in M.O. --- src/atomics/relaxed.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/atomics/relaxed.md b/src/atomics/relaxed.md index f063761..b65e0fd 100644 --- a/src/atomics/relaxed.md +++ b/src/atomics/relaxed.md @@ -122,7 +122,10 @@ pub fn get_id() -> u64 { ``` But then calling that function from multiple threads opens you up to an -execution like below that results in two threads obtaining the same ID: +execution like below that results in two threads obtaining the same ID (note +that the duplication of `1` in the modification order is intentional; even if +two values are the same, they always get separate entries in the order if they +were caused by different accesses): ```text Thread 1 COUNTER Thread 2