Types
ControlBlock = object headMask*: Atomic[ControlMask] ## high uint16, final observed count of slow-path dequeue ops, ## low uint16: current count tailMask*: Atomic[ControlMask] ## Bitmask for storing current reclamation status ## All 3 bits set = node can be reclaimed reclaim*: Atomic[uint8]
- high uint16 final observed count of slow-path enqueue ops low uint16: current count Source Edit
ControlMask = uint32
- Source Edit
Consts
loonyIsolated {.booldefine.} = false
- Indicate that loony should assert that all references passing through the queue have a single owner. Note that in particular, child Continuations have cycles, which will trigger a failure of this assertion. Source Edit
loonyNodeAlignment {.intdefine.} = 11
- Source Edit
loonyRotate {.booldefine.} = true
- Indicate that loony should rotate the slots in the queue to avoid contention on the same cache line. This is useful when the queue is shared between multiple threads. Note that this will only work if the number of slots is a power of 2. Source Edit
loonySlotCount {.intdefine.} = 1024
- Source Edit
lShiftBits = 6
- Source Edit
rShiftBits = 4
- Source Edit
Procs
proc fetchAddHead(ctrl: var ControlBlock; v: uint32 = 1): ControlMask {. ...raises: [], tags: [], forbids: [].}
- Source Edit
proc fetchAddReclaim(ctrl: var ControlBlock; v: uint8 = 1): uint8 {....raises: [], tags: [], forbids: [].}
- Source Edit
proc fetchAddTail(ctrl: var ControlBlock; v: uint32 = 1): ControlMask {. ...raises: [], tags: [], forbids: [].}
- Source Edit
proc getHigh(mask: ControlMask): uint16 {....raises: [], tags: [], forbids: [].}
- Source Edit
proc getLow(mask: ControlMask): uint16 {....raises: [], tags: [], forbids: [].}
- Source Edit