velt/sync/epoch
API referenceEpoch-based reclamation, written in Velt on Atomic, ThreadLocal and Mutex: a way to drop a shared value that other threads may still be reading, once none can be. The compiler calls it for the values an Atomic of a shared value replaces, and opens a section around a function that loads one. For a walkthrough, read the guide.
Exports
collect, and by retire's own collects).outstandingThe values retired on every thread and not dropped yet.pendingThe values retired on this thread and not dropped yet.pinEnters a section: until the matching unpin(), no value retired from now on is dropped, and neither is one retired before that this thread can still reach.retireDrops value once no thread can still be reading it: every thread in a section now has left it.unpinLeaves the section the last pin() entered.Re-exported from velt/sync/epoch/reclaim
function collect(): u64Moves the epoch on if every thread in a section has seen the current one, then drops every value retired 2 epochs or more before, on every thread's list. Returns how many it dropped.
Re-exported from velt/sync/epoch/reclaim
function dropped(): u64The values dropped so far, on every thread (by collect, and by retire's own collects).
Re-exported from velt/sync/epoch/reclaim
function outstanding(): u64The values retired on every thread and not dropped yet.
Re-exported from velt/sync/epoch/reclaim
function pending(): u64The values retired on this thread and not dropped yet.
Re-exported from velt/sync/epoch/reclaim
function pin(): voidEnters a section: until the matching unpin(), no value retired from now on is dropped, and
neither is one retired before that this thread can still reach. Sections nest.
Re-exported from velt/sync/epoch/reclaim
function retire<T>(value: shared<T>): voidDrops value once no thread can still be reading it: every thread in a section now has left
it. Call it for a value just taken out of where other threads find it.
Re-exported from velt/sync/epoch/reclaim
function unpin(): voidLeaves the section the last pin() entered.