Skip to content
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

Generalize ring buffer, differentiate between atomic ring buffer non-atomic ring buffer #10

Open
jrahlf opened this issue Nov 21, 2020 · 1 comment

Comments

@jrahlf
Copy link

jrahlf commented Nov 21, 2020

Hi,

as I understand your ring buffer is targeted for embedded systems, which is exactly what I am using it for.

I think it can be even more generalized, by adding a template option to omit any synchronization and atomicity guarantees for the case that the ringbuffer is not shared between user and interrupt context.

The impact on the generated instructions might be negligible currently, but if PR #9 were implemented, it would make a difference as one would not have to use locks / disable interrupts.

If this ring buffer would provide both an atomic and a non-atomic version, one could truly use it for all usecases 👍
(unless you need a stack :D)

@jnk0le
Copy link
Owner

jnk0le commented Dec 8, 2020

There is fake_tso parameter that makes all atomic accesses relaxed. I don't think that separate non atomic codebase would yield measurable speed/size benefits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants