-
Notifications
You must be signed in to change notification settings - Fork 18
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
Stack overflow from CoroutineScheduler::list() after suspend() -> resume() #19
Comments
Seems like this code inside
|
Hmm, let me take a closer look at this later today.. |
You kinda hit a design flaw in my library. The current implementation of I can think of 2 solutions:
I'm leaning towards (2) because getting rid of that (somewhat dubious) optimization makes the code simpler and fixes this bug. Initially I thought that the library should be able to handle large numbers of coroutines (dozens, if not hundreds). But in real life, I've never really needed more than about 5-10 coroutines. So my current design feels like premature optimization that has come back to bite me. If this library need to scale, I can implement solution (1) to get multiple pools of coroutines, and I can do that with no change to the external API of the library. I got most of the fix done. Just need to clean it up, double check things, and update the docs. Give me a day or two. |
…end() removes coroutine from the internal linked list; causes an immediate resume() to create cycle in linked list (see #19)
…(simpler, faster) instead of insertSorted(); add setupCoroutineOrderedByName() for backwards compatibility for unit tests (see #19)
…e(); explicitly make the properties of internal linked list an unspecified implementation detail (see #19)
I'm in the process of refactoring the README.md. When I'm done with that I will push a new release. Probably today or tomorrow. |
v1.2 released, please give it a spin |
The following code causes a stack overflow within CoroutineScheduler::list() using AceRoutine 1.1.0 and AceCommon 1.1.1 when running on a ESP8266 (NodeMCU 12e module).
I took a quick look into the
loop()
code and based on what its doing its possible that the combination of suspend() -> resume() is creating a circular loop inside the CoroutineScheduler's linked list.The text was updated successfully, but these errors were encountered: