The Wayback Machine - https://web.archive.org/web/20201223155118/https://github.com/tinygo-org/tinygo/pull/1237
Skip to content
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

internal/task,transform: fix coroutines scheduling order #1237

Closed
wants to merge 2 commits into from

Conversation

@niaow
Copy link
Member

@niaow niaow commented Jul 12, 2020

This change applies a loop around resuming a task.
This means that a task will not suspend implicitly when returning from a function.

niaow added 2 commits Jul 12, 2020
This change applies a loop around resuming a task.
This means that a task will not suspend implicitly when returning from a function.
Copy link
Member

@aykevl aykevl left a comment

While the change itself seems fine, it does increase code size a little bit on WebAssembly. Therefore, I wonder why this is necessary? The Go specification does not define a particular order between goroutines unless explicit synchronization is used.

If this is for interrupts, I do not think this is a complete fix. I think interrupts are only really safe when used with the tasks scheduler as it is much easier to reason about ordering and heap allocation (no heap allocation on function calls, for example). The tasks scheduler should be implementable on any reasonable baremetal target.

*rawState

// retcon is set to true when a call returns and awakens it caller.
retcon bool

This comment has been minimized.

@aykevl

aykevl Jul 16, 2020
Member

What does retcon mean? "Return continue"?

@niaow
Copy link
Member Author

@niaow niaow commented Jul 16, 2020

I guess I will work on the coroutines replacement instead

@niaow niaow closed this Jul 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.