romange / helio

A modern framework for backend development based on io_uring Linux interface
Apache License 2.0
435 stars 49 forks source link

fix: mpsc intrusive queue now reports its precise state during Pop #215

Closed romange closed 7 months ago

romange commented 7 months ago

Before, we could get "no element" response, when in fact the queue is not empty. This can happen when tail_ is being in the middle of the update but its "next" field has not been updated yet (inside Push).

Before the change, we treated this state as "Empty", while the queue could have multiple entries (probably 1 or 2). After this change: we retry the pop operation in scheduler until we reach the true depletion of the remote queue.