Feat/async thread pool#387
Open
sinui0 wants to merge 5 commits into
Open
Conversation
Collaborator
Author
|
@th4s here is what I had in mind. We should integration test this with tlsn and make sure there are no performance regressions. I would appreciate if you took over this PR |
Contributor
|
Yeah I will take over. |
Contributor
|
very nice 👍 I get some decent regression in the browser when testing with the tlsn harness: Seems to be a flat 0.3-0.4 seconds extra offset. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #371
Replaces the per-task thread-spawning model in
mpz-commonwith a single shared work-stealing async executor. Each task is an async future that owns a deterministic I/O channel; idle workers steal across each other so a long-running task can't pin work on its creator's thread.Executor(built oncrossbeam-dequeinjector + per-worker queues +async_task).ExecutorBuilderconfiguresnum_threads,prefix, and a custom workerspawncallback (std::thread::spawnby default;web_spawn::spawnon wasm).try_join/try_join3/try_join4usefutures::future::try_join*directly. Closure shape forjoin/try_join*/mapis nowfor<'a> FnOnce(&'a mut Context) -> BoxFuture<'a, R>.Context::mapno longer takes aweightclosure (load balancing is gone with the new executor).Multithread/MultithreadBuilder/Spawnplumbing,mt/andst.rsmodules,load_balance.rs, andCounter.