mirror of
https://github.com/xythrez/RustMP.git
synced 2025-04-19 09:43:31 +00:00
Hotfix: fixed thread pool size being determined at compile time
This commit is contained in:
parent
7de0994fde
commit
84845c0791
1 changed files with 3 additions and 2 deletions
|
@ -1,6 +1,7 @@
|
|||
use hwloc2::{CpuBindError, CpuBindFlags, ObjectType, Topology, TopologyObject};
|
||||
use lazy_static::lazy_static;
|
||||
use std::cmp::max;
|
||||
use std::env::var;
|
||||
use std::sync::Arc;
|
||||
|
||||
lazy_static! {
|
||||
|
@ -64,8 +65,8 @@ impl SystemObject {
|
|||
.collect::<Vec<usize>>();
|
||||
|
||||
let max_num_threads = max(
|
||||
option_env!("RMP_NUM_THREADS")
|
||||
.unwrap_or("")
|
||||
var("RMP_NUM_THREADS")
|
||||
.unwrap_or("".to_string())
|
||||
.parse::<usize>()
|
||||
.unwrap_or(available_hwthreads),
|
||||
1,
|
||||
|
|
Loading…
Add table
Reference in a new issue