sys: add threadsafe ringbuffer#3923
Merged
kaspar030 merged 2 commits intoRIOT-OS:masterfrom Sep 25, 2015
Merged
Conversation
Contributor
|
nice one, will test after we got the release out... |
sys/include/tsrb.h
Outdated
Contributor
There was a problem hiding this comment.
@defgroup sys_tsrb Thread safe ringbuffer
@ingroup sys
@brief Bla BLA BLA
...
Contributor
Author
|
(this will need a little hackery to be thread-safe on atmega) |
a89f4e4 to
ee930d6
Compare
Member
|
Apart from my fundamental critics in the comments, I'd like to merge this for the release... Please squash |
sys/include/tsrb.h
Outdated
Contributor
|
Untested, but the logic looks sane to me. |
a1a41df to
39bd4b1
Compare
Contributor
Author
|
39bd4b1 to
aa321eb
Compare
Contributor
Author
|
Member
There was a problem hiding this comment.
could you also write this requirement somewhere into the doxygen block, so that it appears in the doc? Maybe using a @pre or @note command?
Contributor
Author
|
double green! |
Member
|
Do I get the "free beer" if I ACK and hit the button? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In case there's only one producer and one receiver thread (or ISR), this ringbuffer impementation can be used concurrently without extra locking.
The implementation is a lot simpler than "ringbuffer", e.g., it is not possible to overwrite bytes.