r/cpp • u/Beginning-Safe4282 • May 22 '26
Building a Fast Lock-Free Queue in Modern C++ From Scratch
https://jaysmito.dev/blog/blog/04-fast-lockfree-queues/
135
Upvotes
r/cpp • u/Beginning-Safe4282 • May 22 '26
View all comments
Show parent comment
1
u/Beginning-Safe4282 May 23 '26 edited May 23 '26
To me its usefull if we want to get a rough idea if the que is full or not without some global atomic counter, I know its not accurate as it could be stale by the time it returns the value, and I was Ok with that for the cases it was used, namely deciding whether some worker thread that was sleeping continue to sleep or to wake up.
Its not even needed for the actual queue, its something extra I added just incase any one is interested.