Trying to add batching support to the tryRecv proc was incredibly hard and ultimately failed due to the moving dummy and the non-trivial control flow, hence the v2 design with a fixed dummy node in front.
Pure queue benchmarks are inconclusive, the v3 seems to be slightly better for single task dequeue but is slower for batch dequeue :/.
A rewrite of the core MPSC channel with the following benefits:
This is the revival of the v1 channels that didn't support batching, but with a State Machine twist: https://github.com/mratsim/weave/blob/b796d1a0efb15cad68e2b06ddaa305b08cf5f722/weave/channels/channels_mpsc_unbounded.nim
Trying to add batching support to the
tryRecv
proc was incredibly hard and ultimately failed due to the moving dummy and the non-trivial control flow, hence the v2 design with a fixed dummy node in front.Pure queue benchmarks are inconclusive, the v3 seems to be slightly better for single task dequeue but is slower for batch dequeue :/.
Impact on actual workload to be measured