Remove num_cpus dependency

Functionality already exists in standard library with std:🧵:available_parallelism()

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/380/head
Manos Pitsidianakis 2 weeks ago
parent f70496f14c
commit 11a0586d56
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

11
Cargo.lock generated

@ -1257,7 +1257,6 @@ dependencies = [
"melib",
"nix",
"notify-rust",
"num_cpus",
"pcre2",
"proc-macro2",
"quote",
@ -1445,16 +1444,6 @@ dependencies = [
"autocfg",
]
[[package]]
name = "num_cpus"
version = "1.16.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43"
dependencies = [
"hermit-abi 0.3.2",
"libc",
]
[[package]]
name = "numtoa"
version = "0.1.0"

@ -33,7 +33,6 @@ libz-sys = { version = "1.1", features = ["static"], optional = true }
linkify = { version = "^0.10", default-features = false }
melib = { path = "../melib", version = "0.8.5-rc.3", features = [] }
nix = { version = "0.27", default-features = false, features = ["signal", "poll", "term", "ioctl", "process"] }
num_cpus = "1.12.0"
serde = "1.0.71"
serde_derive = "1.0.71"
serde_json = "1.0"

@ -185,7 +185,10 @@ impl JobExecutor {
jobs: Arc::new(Mutex::new(IndexMap::default())),
};
let mut workers = vec![];
for _ in 0..num_cpus::get().max(1) {
for _ in 0..std::thread::available_parallelism()
.map(Into::into)
.unwrap_or(1)
{
let new_worker = Worker::new_fifo();
ret.workers.push(new_worker.stealer());
let p = Parker::new();

Loading…
Cancel
Save