#[repr(align(64))]pub struct CachePadded<T>(pub T);Expand description
Cache-line padded wrapper for hot atomics.
A counter updated from every worker thread must not share a cache line with
counters other threads write: each update would invalidate the line for
them (false sharing). Deref keeps counter.load(..) / fetch_add(..)
call sites unchanged.
Tuple Fields§
§0: TImplementations§
Source§impl<T> CachePadded<T>
impl<T> CachePadded<T>
Trait Implementations§
Source§impl<T: Debug> Debug for CachePadded<T>
impl<T: Debug> Debug for CachePadded<T>
Source§impl<T: Default> Default for CachePadded<T>
impl<T: Default> Default for CachePadded<T>
Auto Trait Implementations§
impl<T> Forget for CachePadded<T>
impl<T> Freeze for CachePadded<T>where
T: Freeze,
impl<T> Move for CachePadded<T>
impl<T> RefUnwindSafe for CachePadded<T>where
T: RefUnwindSafe,
impl<T> Send for CachePadded<T>where
T: Send,
impl<T> Sync for CachePadded<T>where
T: Sync,
impl<T> Unpin for CachePadded<T>where
T: Unpin,
impl<T> UnsafeUnpin for CachePadded<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for CachePadded<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more