-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Wakeup delayed scheduling #6485
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
Conversation
Caveat: this PR implies and contains #6307 - both are unconditional requirements for using the core schedule class from CoopTasks. |
5aacaa4
to
e57cecc
Compare
afe402c
to
9734760
Compare
be12074
to
dc1219e
Compare
b294bb1
to
2ad8442
Compare
4cb7a7b
to
69af810
Compare
5f959a9
to
dbb1f48
Compare
2a06c11
to
ee9140d
Compare
ee9140d
to
861194e
Compare
Out of curiosity, why is there a need for a FIFO when functions are called pseudo-asynchronously with potentially different timings ? |
…heduled function out from a delayed execution and makes it run on the next scheduler iteration.
Add check for periodic yield to scheduled functions run-loop.
…ing compared to FastScheduler as well as sequential calls from loop().
…e_function() / run_scheduled_functions().
…value vs. that at registering function with scheduler.
…ming. In the future, async future's .then() might take advantage of this direction.
dd3952a
to
e12a369
Compare
I commented this in the commit 2 months ago:
This affected test results with the use of CoopTasks (in this context, think of these as preemptable scheduled functions, stackful coroutines). |
I have a use case for the ESP8266 core schedule class that needs the capability to let recurrent, delayed functions run immediately on the next iteration of the scheduler without taking into account a remaining delay or repeat timeout.
This PR [originally added] an optional parameter
const std::atomic<bool>* wakeupToken
toschedule_recurrent_function_us()
. This was changed, after review comments, into astd::function<bool(void)>
alarm polling callback.The remaining delay or the logic by which the scheduled function return value determines whether to keep scheduling for execution or to be removed from scheduling is unaltered by the alarm.
CoopTask release 2.0.0 depends on this PR for it's new Semaphore with milliseconds timeout.