-
Notifications
You must be signed in to change notification settings - Fork 772
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
Cleanup eventually, cancellable, allow foreground type checking #11153
Conversation
@dsyme could you add a note in the FCS docs about foreground vs. background checking? I honestly don't know the difference here and with all the changes that have gone in to simplify the incremental builder and move things off the reactor, we'll need to update docs to accurately reflect the nature of this stuff |
The document here is still largely valid https://github.com/dotnet/fsharp/blob/main/docs/fcs/queue.fsx. I'll double check it. Essentially FCS currently runs a two-priority queue
Some requests from FSharp.Editor are serviced concurrently without using the queue at all. Anything with "Async" in the return type is likely to representa foreground operation. I'm not particularly tied to the terminology. Our intent is to eventually remove the queue altogether while keeping the background prepare-the-current-project work. However the queue has several operational impacts we need to be mindful of
|
@TIHan This is getting close to being ready
|
|
@TIHan this is ready once green (there was a transient FSharp.Core test failure on Mac, but the PR doesn't touch the FSharp.Core code or tests, it is unrelated) |
Hmmmm
|
@TIHan this is now ready |
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.
Changes all look good/reasonable to me, though this incorporates several API changes to FCS and so we'll need to do an FCS 40. We already have API breaking changes to account for anyways, just more of a note.
Based on conversations with @TIHan, this cleans up the whole eventually/cancellable code so what's going on is much clearer. It builds over #11151
Additionally, the FCS checking of files using *CheckFileInProject operations no longer run on the reactor thread but run on the caller thread. More specifically, using the terminology below, this PR changes the "TypeCheck" part of the CheckFileInProject operation from being "Queued-at-high-priority" (running on reactor thread) to "Concurrent" (runs on caller thread). The *CheckFileInProject operations still have some elements which are Queued-at-high-priority - in particular the preparation of the "prior state" before checking the file, hence the return type is still Async.
repeatedlyProgressUntilDoneOrTimeShareOverOrCanceled
is removed for the much simpler primitiveEventually.forceForTimeSlice
."Eventually" no longer propagates CompilationThreadToken but does propagate a cancellation token. This makes the relationships
Cancellable
-->Eventually
andCancellable
-->Async
clearer, through operationsThe background op of the Reactor becomes an
Eventually<unit>
. That is the op may be run for a time slice and then continuedOperations queue terminology
I've updated the doc here https://github.com/dotnet/fsharp/pull/11153/files#diff-5559c50e82ea049a7d5af789014c903e43fde092e13a555c58f8798b167c74ed