mirror of
https://github.com/YGGverse/aquatic.git
synced 2026-04-02 10:45:30 +00:00
Feature-gate CPU pinning, since it only works on Linux
This commit is contained in:
parent
c90c82fb5c
commit
4f8328b70a
22 changed files with 77 additions and 19 deletions
|
|
@ -9,10 +9,9 @@ use std::{
|
|||
};
|
||||
|
||||
use crate::config::Config;
|
||||
use aquatic_common::{
|
||||
cpu_pinning::{pin_current_if_configured_to, WorkerIndex},
|
||||
privileges::drop_privileges_after_socket_binding,
|
||||
};
|
||||
#[cfg(feature = "cpu-pinning")]
|
||||
use aquatic_common::cpu_pinning::{pin_current_if_configured_to, WorkerIndex};
|
||||
use aquatic_common::privileges::drop_privileges_after_socket_binding;
|
||||
|
||||
use self::common::*;
|
||||
|
||||
|
|
@ -41,6 +40,7 @@ pub fn run_inner(config: Config, state: State) -> anyhow::Result<()> {
|
|||
let num_bound_sockets = num_bound_sockets.clone();
|
||||
|
||||
let executor = LocalExecutorBuilder::default().spawn(move || async move {
|
||||
#[cfg(feature = "cpu-pinning")]
|
||||
pin_current_if_configured_to(
|
||||
&config.cpu_pinning,
|
||||
config.socket_workers,
|
||||
|
|
@ -68,6 +68,7 @@ pub fn run_inner(config: Config, state: State) -> anyhow::Result<()> {
|
|||
let response_mesh_builder = response_mesh_builder.clone();
|
||||
|
||||
let executor = LocalExecutorBuilder::default().spawn(move || async move {
|
||||
#[cfg(feature = "cpu-pinning")]
|
||||
pin_current_if_configured_to(
|
||||
&config.cpu_pinning,
|
||||
config.socket_workers,
|
||||
|
|
@ -88,6 +89,7 @@ pub fn run_inner(config: Config, state: State) -> anyhow::Result<()> {
|
|||
)
|
||||
.unwrap();
|
||||
|
||||
#[cfg(feature = "cpu-pinning")]
|
||||
pin_current_if_configured_to(
|
||||
&config.cpu_pinning,
|
||||
config.socket_workers,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue