pub struct VmTaskDriverBuilder<'a> { /* private fields */ }Expand description
A builder returned by VmTaskDriverSource::builder.
Implementations§
Source§impl VmTaskDriverBuilder<'_>
impl VmTaskDriverBuilder<'_>
Sourcepub fn run_on_target(&mut self, run_on_target: bool) -> &mut Self
pub fn run_on_target(&mut self, run_on_target: bool) -> &mut Self
A hint to the backend specifying whether spawned tasks should always run on the thread handling the target VP.
If false (the default), then when spawned tasks are awoken, they may
run on any executor (such as the current one). If true, the backend
will endeavor to run them on the same thread that would drive async IO.
Some devices will want to override the default to reduce jitter or ensure that IO is issued from the correct processor. For example, StorVSP sets this to true for its channel workers, so that all of a channel’s IO and tasks ideally run on the same VP’s thread.
Sourcepub fn target_vp(&mut self, target_vp: u32) -> &mut Self
pub fn target_vp(&mut self, target_vp: u32) -> &mut Self
A hint to the backend specifying the guest VP associated with spawned tasks and IO.
Backends can use this to ensure that spawned tasks and async IO will run
near or on the target VP. For example, StorVSP sets this to the VP
from the VMBus channel open request’s target_vp field, so that
each channel’s worker runs on the VP the guest specified.
If not set, the backend uses its default scheduling (typically the calling thread or a shared pool).
Sourcepub fn build(&self, name: impl Into<String>) -> VmTaskDriver
pub fn build(&self, name: impl Into<String>) -> VmTaskDriver
Builds a VM task driver.
name is used by some backends to identify a spawned thread. It is
ignored by other backends.