Struct xsynth_render::ParallelismOptions
source · pub struct ParallelismOptions {
pub channel: ThreadCount,
pub key: ThreadCount,
}
Expand description
Options regarding which parts of the ChannelGroup should be multithreaded.
Responsibilities of a channel: processing input events for the channel, dispatching per-key rendering of audio, applying filters to the final channel’s audio
Responsibilities of a key: Rendering per-voice audio for all the voices stored in a key for a channel. This is generally the most compute intensive part of the synth.
Best practices:
- As there are often 16 channels in MIDI, per-key multithreading can balance out the load more evenly between CPU cores.
- However, per-key multithreading adds some overhead, so if the synth is invoked to render very small sample counts each time (e.g. sub 1 millisecond), not using per-key multithreading becomes more efficient.
Fields§
§channel: ThreadCount
Render the MIDI channels parallel in a threadpool with the specified thread count.
key: ThreadCount
Render the individisual keys of each channel parallel in a threadpool with the specified thread count.
Implementations§
source§impl ParallelismOptions
impl ParallelismOptions
pub const AUTO_PER_KEY: ParallelismOptions = _
pub const AUTO_PER_CHANNEL: ParallelismOptions = _
Trait Implementations§
source§impl Clone for ParallelismOptions
impl Clone for ParallelismOptions
source§fn clone(&self) -> ParallelismOptions
fn clone(&self) -> ParallelismOptions
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Default for ParallelismOptions
impl Default for ParallelismOptions
source§fn default() -> ParallelismOptions
fn default() -> ParallelismOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParallelismOptions
impl RefUnwindSafe for ParallelismOptions
impl Send for ParallelismOptions
impl Sync for ParallelismOptions
impl Unpin for ParallelismOptions
impl UnwindSafe for ParallelismOptions
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)