Skip to content

AhoyISki/thread-count

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thread-count

This is a fork of thread-amount, since that crate is archived and no longer works.

Crate Version Documentation License

Get the number of threads in the current process

Example Usage

Cargo.toml

[dependencies]
thread-count = "0.1"

The code:

use thread_count::thread_count;

use std::thread;

fn main() {
    let count = thread_count();

    thread::spawn(move || {
        assert_eq!(count.map(NonZeroUsize::get), Some(1))
    });
}

Difference between num-threads

This crate has windows support and reads the /proc/[PID]/status file in -unix systems.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Tomio

💻 📖 💡 🚇 🚧

This project follows the all-contributors specification. Contributions of any kind welcome!

License

Licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT)

About

Get the amount of threads in the current process

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rust 100.0%