mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fix thread priorities (kind of).
This commit is contained in:
parent
0c99438993
commit
7357aaf1ab
@ -338,7 +338,8 @@ impl State {
|
||||
};
|
||||
let total = total.max(common::consts::MIN_RECOMMENDED_RAYON_THREADS);
|
||||
let cores = core_affinity::get_core_ids().unwrap_or(vec![]).into_iter().skip(start).step_by(step).take(total).collect::<Vec<_>>();
|
||||
let floating = total.saturating_sub(cores.len());
|
||||
let num_cores = cores.len();
|
||||
let floating = total.saturating_sub(num_cores);
|
||||
// TODO: NUMA utils
|
||||
let slow_pool = slowjob::ThreadPoolBuilder::new()
|
||||
.thread_name(move |i| format!("slowjob-{}-{}", thread_name_infix, i))
|
||||
@ -352,7 +353,7 @@ impl State {
|
||||
}
|
||||
// pinned slowjob threads run with low priority
|
||||
let index = thread.index();
|
||||
if index < floating {
|
||||
if index < num_cores {
|
||||
b = b.priority(ThreadPriority::Min);
|
||||
}
|
||||
b.spawn_careless(|| thread.run())?;
|
||||
|
Loading…
x
Reference in New Issue
Block a user