swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.2k stars 10.32k forks source link

Consider how much of SourceKit-LSP’s `TaskScheduler` we could implement in the language or via executors #73372

Open ahoppen opened 3 months ago

ahoppen commented 3 months ago

SourceKit-LSP implements its own custom task scheduler (https://github.com/apple/sourcekit-lsp/pull/1208) for background indexing for three reasons:

I’m not sure if it makes sense to add support for either (or both) of these things to the concurrency runtime or to allow custom executors to perform these things.

ktoso commented 3 months ago

Thanks, even though a bit vague I think this uncovers a bunch of ideas we might want to allow:

Should an executor be able to:

Given those I think it would be possible to have a scheduler which works the way you request it to -- it keeps track of its jobs and runs them until completion with some width limit etc. There's definitely pieces we can carve out of the this and improve power of executors.