Closed davetcc closed 4 years ago
Once the cause is determined, add it to the task manager unit test cases.
This has been located with high probability. TaskManagerIO is a cooperative scheduler which means it is inherently an unfair scheduler. As a result if a task constantly provides a 0 microsecond time to it's next execution, it will constantly run and it will not get around to running other tasks. Events should NEVER continually return 0 microseconds in their timeToNextCheck call.
We are soak testing the modified sketch and will close this issue when we don't see the issue after a day of execution.
Ensure that the documentation makes clear that an event repeating with a 0 delay will never return control to anything else.
The follow sketch will freeze after some time:
https://github.com/davetcc/LiquidCrystalIO/blob/master/examples/TaskMgrIntegration/TaskMgrIntegration.ino
It's not clear if all tasks are out of order, waiting behind a task with longer delay, or another problem.