pub struct TpcConfig {
pub num_cores: usize,
pub key_spec: KeySpec,
pub cpu_pinning: bool,
pub cpu_start: usize,
pub inbox_capacity: usize,
pub outbox_capacity: usize,
pub reactor_config: ReactorConfig,
pub numa_aware: bool,
pub enable_storage_io: bool,
pub io_uring_config: Option<IoUringConfig>,
}Expand description
Configuration for the thread-per-core runtime.
Fields§
§num_cores: usizeNumber of cores to use
key_spec: KeySpecKey specification for routing
cpu_pinning: boolWhether to pin cores to CPUs
cpu_start: usizeStarting CPU ID for pinning (cores use cpu_start, cpu_start+1, …)
inbox_capacity: usizeInbox queue capacity per core
outbox_capacity: usizeOutbox queue capacity per core
reactor_config: ReactorConfigReactor configuration (applied to all cores)
numa_aware: boolEnable NUMA-aware memory allocation
enable_storage_io: boolEnable per-core storage I/O backend.
When true, each core gets a StorageIo
instance. On Linux with io-uring feature, uses io_uring with SQPOLL.
Everywhere else, uses synchronous std::fs.
io_uring_config: Option<IoUringConfig>io_uring configuration (Linux only, requires io-uring feature).
When enable_storage_io is true and this is Some, the io_uring
backend is used. When None, falls back to the sync backend.
Implementations§
Source§impl TpcConfig
impl TpcConfig
Sourcepub fn builder() -> TpcConfigBuilder
pub fn builder() -> TpcConfigBuilder
Creates a new configuration builder.
Sourcepub fn auto() -> Self
pub fn auto() -> Self
Creates configuration with automatic detection.
Detects system capabilities and generates an optimal configuration:
- Uses all available physical cores (minus 1 on systems with >8 cores)
- Enables CPU pinning on multi-core systems
- Enables NUMA-aware allocation on multi-socket systems
§Example
use laminar_core::tpc::TpcConfig;
let config = TpcConfig::auto();
println!("Using {} cores", config.num_cores);Trait Implementations§
Auto Trait Implementations§
impl Freeze for TpcConfig
impl RefUnwindSafe for TpcConfig
impl Send for TpcConfig
impl Sync for TpcConfig
impl Unpin for TpcConfig
impl UnsafeUnpin for TpcConfig
impl UnwindSafe for TpcConfig
Blanket Implementations§
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more