Consolidate take_front code in DRR queues
`drr_queue::take_front` and `drr_cached_queue::take_front` were essentially the same function. Moreover, `drr_cached_queue::new_round` duplicated the algorithm a third time (entangled with the actual logic for a new credit round). The new `task_queue::next` funciton now implements this algorithm once. Moreover, `take_front` is only used directly from `blocking_actor::dequeue`. This function bypasses the deficit counter on the caller side. To clean up the awkward use of the queue, the new `take_front` of the cached DRR queue bypasses the deficit counter internally. Restructuring the code seems to fix the original issue as well. After debugging this extensively, it appears that GCC emitted code that didn't properly track reads and writes to the head node. Reading `begin().ptr` twice (via printf) causes the value to change between reads - even though the printf statements where on consecutive lines.
Showing
Please register or sign in to comment