XZ Utils  5.2.4
Functions
hardware_cputhreads.c File Reference

Get the number of CPU threads or cores. More...

#include "common.h"
#include "tuklib_cpucores.h"

Functions

uint32_t lzma_cputhreads (void)
 Get the number of processor cores or threads. More...
 

Detailed Description

Get the number of CPU threads or cores.

Function Documentation

◆ lzma_cputhreads()

uint32_t lzma_cputhreads ( void  )

Get the number of processor cores or threads.

This function may be useful when determining how many threads to use. If the hardware supports more than one thread per CPU core, the number of hardware threads is returned if that information is available.

On success, the number of available CPU threads or cores is returned. If this information isn't available or an error occurs, zero is returned.

Referenced by hardware_threads_set().