File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 4343//!
4444//! That said, Rust *does* inherit the C++ limitation that non-synchronized atomic accesses may not
4545//! partially overlap: they must be either disjoint or access the exact same memory. This in
46- //! particular rules out non-synchronized differently-sized accesses to the same data.
46+ //! particular rules out non-synchronized differently-sized atomic accesses to the same data.
47+ //! (Non-synchronized differently-sized non-atomic read accesses are permitted.)
4748//!
4849//! [cpp]: https://en.cppreference.com/w/cpp/atomic
4950//! [cpp-intro.races]: https://timsong-cpp.github.io/cppwp/n4868/intro.multithread#intro.races
Original file line number Diff line number Diff line change @@ -304,8 +304,7 @@ impl AccessType {
304304 }
305305}
306306
307- /// Memory Cell vector clock metadata
308- /// for data-race detection.
307+ /// Per-byte vector clock metadata for data-race detection.
309308#[ derive( Clone , PartialEq , Eq , Debug ) ]
310309struct MemoryCellClocks {
311310 /// The vector-clock timestamp and the thread that did the last non-atomic write. We don't need
@@ -324,8 +323,8 @@ struct MemoryCellClocks {
324323 read : VClock ,
325324
326325 /// Atomic access, acquire, release sequence tracking clocks.
327- /// For non-atomic memory in the common case this
328- /// value is set to None .
326+ /// For non-atomic memory this value is set to None.
327+ /// For atomic memory, each byte carries this information .
329328 atomic_ops : Option < Box < AtomicMemoryCellClocks > > ,
330329}
331330
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ fn convert(a: &AtomicU16) -> &[AtomicU8; 2] {
1010}
1111
1212// We can't allow mixed-size accesses; they are not possible in C++ and even
13- // Intel says you shouldn't do it.
13+ // Intel says you shouldn't do it. Even read-read races are disallowed that way.
1414fn main ( ) {
1515 let a = AtomicU16 :: new ( 0 ) ;
1616 let a16 = & a;
You can’t perform that action at this time.
0 commit comments