lean4-htt/src
Marc Huisinga b49ec19167
feat: more robust server parallelism (#7087)
This PR ensures that all tasks in the language server either use
dedicated tasks or reuse an existing thread from the thread pool. This
ensures that elaboration tasks cannot prevent language server tasks from
being scheduled. This is especially important with parallelism right
around the corner and elaboration becoming more likely to starve the
language server of computation, which could drive up language server
latencies significantly on machines with few cores.

Specifically, all language server tasks are refactored to use a new thin
`ServerTask` API wrapper with a single "costly" vs "cheap" dimension,
where costly tasks are always scheduled as dedicated tasks, and cheap
tasks are always made to either run on the calling thread or to reuse
the thread of the task being mapped on by using the `sync` flag.

ProofWidgets4 adaption PR:
https://github.com/leanprover-community/ProofWidgets4/pull/106

### Other changes
- This PR makes several tasks dedicated that weren't dedicated before,
and uses `sync := true` for some others. The rules for this are
described in the module docstring of `ServerTask.lean`.
- Most notably, the reporting task in the file worker was *not* a
dedicated task before this PR, which could easily lead to thread pool
starvation on successive changes. It also did not support cancellation.
This PR ensures that it does.

### Breaking changes

- `RequestTask` and the request-oriented snapshot API are refactored to
use `ServerTask` instead of `Task`. All functions in `Task` have close
analogues in `ServerTask`, and functions on `RequestTask` now need to
distinguish between whether a `map` or a `bind` is cheap or costly. This
affects all downstream users of `RequestM`, e.g. tools that extend the
language server with their own requests, or some users of the RPC
mechanism.
- The following unused functions of the `AsyncList` API have been
deleted: `append`, `unfoldAsync`, `getAll`, `waitHead?`, `cancel`
2025-02-20 10:54:22 +00:00
..
bin feat: API to avoid deadlocks from dropped promises (#6958) 2025-02-07 15:33:10 +00:00
cmake fix: Windows stage0 linking (#6622) 2025-01-14 09:09:50 +01:00
include/lean feat: IntX.abs (#7131) 2025-02-18 13:16:30 +00:00
Init feat: strengthen Int.tdiv_eq_ediv (#7158) 2025-02-20 05:57:47 +00:00
initialize fix: explicitly initialize Std in lean_initialize (#4668) 2024-07-06 13:17:30 +00:00
kernel feat: split Lean.Kernel.Environment from Lean.Environment (#5145) 2025-01-18 18:42:57 +00:00
lake feat: lake: support plugins (#7001) 2025-02-14 04:57:31 +00:00
Lean feat: more robust server parallelism (#7087) 2025-02-20 10:54:22 +00:00
library feat: smarter plugin loading (#7090) 2025-02-18 23:03:52 +00:00
runtime feat: smarter plugin loading (#7090) 2025-02-18 23:03:52 +00:00
shell chore: avoid rebuilding leanmanifest in each build (#5057) 2024-08-15 14:55:36 +00:00
Std feat: modify and alter functions for the tree map (#7118) 2025-02-20 09:50:10 +00:00
util feat: smarter plugin loading (#7090) 2025-02-18 23:03:52 +00:00
cadical.mk feat: ship cadical (#4325) 2024-08-23 09:13:27 +00:00
CMakeLists.txt chore: begin development cycle for v4.18.0 (#6943) 2025-02-04 05:47:20 +00:00
config.h.in
githash.h.in
Init.lean feat: binderNameHint (#6947) 2025-02-06 11:03:27 +00:00
lakefile.toml.in feat: introduce Std (#4499) 2024-06-21 07:08:45 +00:00
lean-toolchain
Lean.lean feat: premise selection API (#7061) 2025-02-14 04:08:18 +00:00
lean.mk.in chore: trivial changes from async-proofs branch (#7028) 2025-02-10 16:44:05 +00:00
Leanc.lean feat: expose flags for the bundled C compiler (#4477) 2024-06-22 01:23:33 +00:00
Std.lean feat: Std.Net.Addr (#6563) 2025-01-09 09:33:03 +00:00
stdlib.make.in chore: build Lean with Elab.async (#6989) 2025-02-10 18:16:20 +00:00
stdlib_flags.h feat: add debug.proofAsSorry (#6300) 2024-12-03 23:21:38 +00:00
version.h.in chore: tag prerelease builds with -pre (#5943) 2024-11-06 14:47:52 +00:00