-
Notifications
You must be signed in to change notification settings - Fork 3
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
Add a CPU yield awaitable. #2
Comments
Could a "poor man's version" of a co_await 0ms; PS's:
|
Yes, that is indeed a poor man's version. The ultimate version would have a sense of priority. Some running tasks could be purely "maintenance" type with no set deadline of execution. I think the question will remain opened/work in progress for a while.
I appreciate your comments. And I do agree with them. Unfortunately, I have been busy with many a thing and this library has been on the back burner, but I will get back to it and try to help with the descriptions your last two comments ask for. Cheers. |
A purely coroutine based multi-tasking system needs all tasks to be good citizen of the cooperative multi-tasking system, yielding the CPU to other tasks in a periodic manner, enabling long running compute intensive tasks to run while not stopping other tasks from operating.
A yield awaitable object is a clean way of achieving this goal. It can be awaited periodically in long running loops:
An example of such use is for the SSD1306 code. Filling the OLED screen buffer to print text can take tens of thousands of cycles.
The routine performing this operation should be capable of yielding so that time-critical operations can take place.
The text was updated successfully, but these errors were encountered: