#[repr(C)]pub struct Pointers<T, M>where
M: Memory,{ /* private fields */ }
Expand description
A collection of hazardous pointers.
Implementations§
Source§impl<T, M> Pointers<T, M>where
M: Memory,
impl<T, M> Pointers<T, M>where
M: Memory,
Sourcepub fn new(memory: M, threads: usize, domains: usize, threshold: usize) -> Self
pub fn new(memory: M, threads: usize, domains: usize, threshold: usize) -> Self
Constructs a new Pointers
.
The maximum number of threads is specified by threads
and the maximum number of hazardous
pointers per thread is specified by domains
.
The maximum size lists of retired pointers can grow to is specified by threshold
. Once a
list of retired pointers reaches this limit, any pointers that are no longer hazardous are
removed from the list and the memory they refer to is deallocated.
Sourcepub fn mark(
&self,
thread: usize,
domain: usize,
pointer: &AtomicPtr<T>,
) -> *mut T
pub fn mark( &self, thread: usize, domain: usize, pointer: &AtomicPtr<T>, ) -> *mut T
Sets the hazardous pointer for the supplied domain using the supplied thread.
Forward progress guarantee: lock-free.
Sourcepub fn mark_ptr(&self, thread: usize, domain: usize, pointer: *mut T) -> *mut T
pub fn mark_ptr(&self, thread: usize, domain: usize, pointer: *mut T) -> *mut T
Sets the hazardous pointer for the supplied domain using the supplied thread.
Forward progress guarantee: wait-free population oblivious.
Sourcepub fn clear(&self, thread: usize, domain: usize)
pub fn clear(&self, thread: usize, domain: usize)
Clears the hazardous pointer for the supplied domain using the supplied thread.
Forward progress guarantee: wait-free population oblivious.