XAsync pool: idle workers end, bursts stop at a cap, delayed callbacks share one timer thread (rest of #228) #466
No reviewers
Labels
No labels
accessibility
already-solved
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
merged
needs-decision
needs-game-run
needs-rebase
not-merged
nvidia
obsolete
question
security
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/avatarmanz--VIctory-7900XTX!466
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-466"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@illuminatedfellow on GitHub · 2026-11-27 13:40 UTC · original
illuminatedfellow:xasync-pool-cap→main· +688 −56 · 1 files · 2 commits · openPart of #228 (item 3). Stacked on #244: this branch is #244's commit plus one more, so review the last commit, or wait for #244 to merge and the diff here shrinks to it.
What changes, in
crates/victory-hle/src/modules/xasync.rs:XTaskQueueSubmitDelayedCallback,XAsyncSchedulewith a delay) now wait on one timer thread and are delivered on the pool, instead of each starting a thread that sleeps out its delay.Termination still takes a queue's callbacks back out of the pool and cancels them: the pool keeps titles' callbacks apart from its own jobs.
Tests added:
idle_pool_workers_enda_burst_starts_no_more_workers_than_the_capa_stalled_pool_grows_past_its_capdelayed_callbacks_do_not_start_a_thread_each: fails on #244 alone (200 threads for 200 delayed callbacks), passes here.Tested on Linux with
xasync.rsbuilt alone with a stub forxgameruntime, sincevictory-hleneeds Windows to build: all 20 xasync tests pass, 60 runs in release, 20 in debug and 15 under CPU load without a failure;clippy --all-targets -D warningsis clean on Rust 1.97. Not built with the pinned 1.98.1 or on Windows; CI here will be the first run of that.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.