-
Notifications
You must be signed in to change notification settings - Fork 955
internal/task: remove coroutines #2448
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
58d2bd9
to
2b609e2
Compare
This is a bit bigger than I expected, so I don't think it is necessarily a good idea to include this for this release. Next release cycle I would like to refactor a lot of the things that used to depend on coroutines. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Phew! That's indeed a big PR. I did expect it to be pretty big though...
I think I would have tried to split this into multiple commits (remove coroutines scheduler, remove switch implementation of functions, and then remove the parentHandle
parameter). But I'm not going to complain.
We might want to test AVR some more just to be sure, see below.
Anyway, giving a preliminary LGTM now.
case "none", "coroutines": | ||
// As "doubleword", but with the function pointer replaced by a unique | ||
// ID per function signature. Function values are called by using a | ||
// switch statement and choosing which function to call. | ||
// Pick the switch implementation with the coroutines scheduler, as it | ||
// allows the use of blocking inside a function that is used as a func | ||
// value. | ||
return "switch" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI: this does have an effect on AVR which used -scheduler=none
by default. This used to be necessary because function pointers used to be buggy in AVR but I believe it should work now (except a very small increase in binary size sometimes which I think is acceptable).
Yeah, I can try to do that |
2b609e2
to
ef2fec3
Compare
This PR has now been split into 3 less-huge commits. |
ef2fec3
to
66a98ef
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
Feel free to fix (probably trivial) merge conflicts and merge the PR.
The switched func lowering was mainly necessary for coroutines. With coroutines removed, this is no longer necessary.
This removes the parentHandle argument from the internal calling convention. It was formerly used to implment coroutines. Now that coroutines have been removed, it is no longer necessary.
66a98ef
to
d239909
Compare
I need to look into why there is an issue with the closure on Windows. |
It seems to be a random error. . . which is concerning. I also distinctly remember running into that exact error before (so I don't think it is caused by this PR). I strongly suspect that the actual fix is #2433, which I now realize I forgot to finish debugging. |
I created #2551 for now |
IDK, does anyone object to merging this now? |
I'm all for merging it if it will prevent bad user experiences. We can always resurrect coroutines later... |
No description provided.