Remove num_cpus dependency
Run cargo lints / Lint on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 8m0s
Details
Cargo manifest lints / Lint Cargo manifests on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 11m50s
Details
Run Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 11m9s
Details
Run cargo lints / Lint on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 8m0s
Details
Cargo manifest lints / Lint Cargo manifests on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 11m50s
Details
Run Tests / Test on ${{ matrix.build }} (linux-amd64, ubuntu-latest, stable, x86_64-unknown-linux-gnu) (pull_request) Successful in 11m9s
Details
Functionality already exists in standard library with std:🧵:available_parallelism()
Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/380/head
parent
f70496f14c
commit
11a0586d56
|
@ -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…
Reference in New Issue