seanmonstar / num_cpus

Get the number of CPUs in Rust
Apache License 2.0
582 stars 91 forks source link

Optimistic get logical processor call #93

Open UnicodingUnicorn opened 4 years ago

UnicodingUnicorn commented 4 years ago

Should resolve #79. A fairly optimistic count of 16 is set before calling GetLogicalProcessorInformation, being recalculated if it is less than the returned needed_size. The code afterwards should handle the case where the preset count is higher than the actual count.