Function glib::num_processors

source ·
pub fn num_processors() -> u32
Expand description

Determine the approximate number of threads that the system will schedule simultaneously for this process. This is intended to be used as a parameter to [ThreadPool::new()][crate::ThreadPool::new()] for CPU bound tasks and similar cases.

Returns

Number of schedulable threads, always greater than 0