-
Notifications
You must be signed in to change notification settings - Fork 671
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
some questions #134
Comments
It sounds like you want a circular ring-buffer that supports elements being overwritten on overflow. It is not possible to overwrite elements with my queue, however you can limit the number of elements using either the |
@cameron314 an overwriting circular buffer would be very useful for audio (DSP->GUI thread) visualizations, which is a fairly common scenario for me. I did think about this a fair bit and dug through the circular buffer code, but decided that while it would be cool to pop if there were no slots left during an enqueue, there's no thread safe way to do this from the producer thread. Does your answer here confirm that? In that particular case, and when limited to scalars, I wonder if a simple array of std::atomic using the power of two mask trick for modulo would suffice 🤔 |
Right, not really feasible with the current design. Yes, this could be done for |
Hello: if the dequeue work very slowly, the queue will become bigger and bigger, is there some limit or max level for the queue? can we delete the element
The text was updated successfully, but these errors were encountered: