-
Notifications
You must be signed in to change notification settings - Fork 13.3k
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
Refactor linked list to lock-free ring buffer #6139
Conversation
Do you have other use-cases for this ring buffer ? |
@d-a-v The queue is used in EspSoftwareSerial. |
@d-a-v @devyte I've prepared a test sketch that stresses the queue implementation of the Scheduler. In terms of quality, the circular queue suffers a performance degredation (24s real time) when the chunk size is increased to 50, this is expected behavior due to the many failed and repeated attempts to insert into the well exhausted queue of size 32. Please check for yourself and comment if I've egregiously misses something:
|
Thanks for your work and your proofs/tests. |
@d-a-v git submodules... but have a point here, certainly. |
97ef85b
to
2a5777b
Compare
@d-a-v I've implemented the Ticker-based timing here - this eliminates the use of PolledTimeout except for the 100ms period yielding.
|
The ESP8266 already has convenience functions that call
|
dfa18a7
to
83db501
Compare
@d-a-v You might like the latest commit 5a8584a : now the PolledTimeout is used for delays/periods up to 5000µs, where polling is quite sane, I guess, whereas for longer delays above the 5000µs minimum of Ticker, the latter is used, alleviating the load on the scheduler of polling tasks that will not be runnable for quite a few cycles. |
@d-a-v With |
57dda0d
to
02dbff2
Compare
a979416
to
6af67c6
Compare
b8e8c13
to
3cb6f18
Compare
3cb6f18
to
b28837b
Compare
Note: feature branches rebase against master, never in ongoing work merge master. Master eventually merges feature branches, does not rebase on feature branches (why should it). |
b28837b
to
26f453a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are conflicts now, do you want to reaolve now, or do you want to wait until the other attachInterrupt stuff is out of the way?
33793e3
to
c54ca52
Compare
Rebase - done. |
bc052b6
to
256406a
Compare
4ee7dd9
to
b5a2583
Compare
…at all - don't use at all.
…o libraries, too.
…result in another PR.
d8d777d
to
3aceb03
Compare
Preparation for this library is now in other, simpler PRs. This library is not strictly needed, as the functionality exists in Schedule. Portability to ESP32 makes it preferable to take this to a standalone library. Closing PR. Thanks for the review! |
This amends #6039 to use a circular queue that is lock-free between producer/consumer and is tested on ESP8266, ESP32 and x86_64.