-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Description
jld mentioned on IRC that it would be bad if a blocking IO system call blocked the entire rust scheduler thread, so that it couldn't schedule other threads in the meantime.
It would be useful to have a library which wraps blocking IO calls with a call to task::task().sched_mode(manual_threads(1)).spawn
so that when the kernel blocks that thread rust can schedule other threads on the existing scheduler. (The calling task would block on the exit+response of the 1:1-threaded task.)
An interesting researchy/heuristic problem part of this would be figuring out when it would be more expensive to create the new scheduler thread than to just call and block directly.
Metadata
Metadata
Assignees
Labels
A-concurrencyArea: ConcurrencyArea: ConcurrencyA-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.