estdlib icon indicating copy to clipboard operation
estdlib copied to clipboard

layer1::deque thread safety

Open malachib opened this issue 4 months ago • 0 comments

Upgrade layer1::deque circular queue to use a burn-the-bool/burn-the-slot (sentinel) approach. In particular, the model where one queue slot is burned to know if we're full or empty.

In doing so, upgrade to use std::atomic/_Atomic

Consider also adding another mode where we never know if we're full

Consider configuring one of these 3 modes (bool, slot burn, minimal) via TPolicy

Interesting support articles: https://embeddedartistry.com/blog/2017/05/17/creating-a-circular-buffer-in-c-and-c/?utm_source=chatgpt.com https://docs.kernel.org/core-api/circular-buffers.html

Take this opportunity also to more carefully (and perhaps automatically) select between uninitialized_array and native array

malachib avatar Aug 31 '25 16:08 malachib