-
Notifications
You must be signed in to change notification settings - Fork 825
Resumable cancellable with trampolined binds #18733
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
base: main
Are you sure you want to change the base?
Conversation
❗ Release notes requiredCaution No release notes found for the changed paths (see table below). Please make sure to add an entry with an informative description of the change as well as link to this pull request, issue and language suggestion if applicable. Release notes for this repository are based on Keep A Changelog format. The following format is recommended for this repository:
If you believe that release notes are not necessary for this PR, please add NO_RELEASE_NOTES label to the pull request. You can open this PR in browser to add release notes: open in github.dev
|
@@ -4869,7 +4869,7 @@ module TcDeclarations = | |||
//------------------------------------------------------------------------- | |||
// Bind module types | |||
//------------------------------------------------------------------------- | |||
|
|||
#nowarn FS3511 |
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.
This is failing to compile statically, which is another problem.
(side thought - if we had a compiler-only usage of an async variant, we could use it to dogfood under flags when we decide to use runtime's async implementation. The compiler could also provide testing of deeply recursive scenarios there - might be valuable even for the runtime impl itself. But obviously we would have to accept the change of semantics, which will not work for the general library usage of async) |
This is currently driven be an explicit synchronous loop. Another approach would be to use something similar to The problem would be with propagating exceptions (including cancellation) from deep call chains. It could get very expensive, because of async stack trace stitching, see (TheAngryByrd/IcedTasks#3 (comment)). As a side note, current |
Description
Just to see if it works at all. Don't worry about it.
This is revived #18285 with cancellable CE reimplemented using resumable code.
Binds are trampolined so if things do work, deep recursion should not be a problem regardless of tailcalls.
The complexity probably makes it not worth it to reimplement just the
cancellable
, but it could be a starting point to replace internally all the asyncs (and cancellables) in FCS with a compatible and more effective resumableasync2
implementation.