Add parallel shred signing to shredder (#5964)

This commit is contained in:
Sagar Dhawan
2019-09-18 18:00:07 -07:00
committed by GitHub
parent 48d754220b
commit e0858cfe06
2 changed files with 28 additions and 7 deletions

View File

@ -4,9 +4,12 @@ extern crate lazy_static;
use std::sync::RwLock;
//TODO remove this hack when rayon fixes itself
lazy_static! {
// reduce the number of threads each pool is allowed to half the cpu core count, to avoid rayon
// hogging cpu
static ref MAX_RAYON_THREADS: RwLock<usize> =
RwLock::new(sys_info::cpu_num().unwrap() as usize);
RwLock::new(sys_info::cpu_num().unwrap() as usize / 2);
}
pub fn get_thread_count() -> usize {