GNU libmicrohttpd 1.0.1
Loading...
Searching...
No Matches
mhd_tool_get_cpu_count.h File Reference

Declaration of functions to detect the number of available CPU cores. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

int mhd_tool_get_proc_cpu_count (void)
int mhd_tool_get_system_cpu_count (void)

Detailed Description

Declaration of functions to detect the number of available CPU cores.

Author
Karlson2k (Evgeny Grin)

Definition in file mhd_tool_get_cpu_count.h.

Function Documentation

◆ mhd_tool_get_proc_cpu_count()

int mhd_tool_get_proc_cpu_count ( void )

Detect the number of logical CPU cores available for the process. The number of cores available for this process could be different from value of cores available on the system. The OS may have limit on number assigned/allowed cores for single process and process may have limited CPU affinity.

Returns
the number of logical CPU cores available for the process or -1 if failed to detect

Definition at line 524 of file mhd_tool_get_cpu_count.c.

References mhd_tool_get_proc_cpu_count_cpuset_getaffinity_(), mhd_tool_get_proc_cpu_count_sched_getaffinity_(), mhd_tool_get_proc_cpu_count_sched_getaffinity_np_(), and mhd_tool_get_proc_cpu_count_w32_().

Referenced by mhd_tool_get_system_cpu_count().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mhd_tool_get_system_cpu_count()

int mhd_tool_get_system_cpu_count ( void )

Try to detect the number of logical CPU cores available for the system. The number of available logical CPU cores could be changed any time due to CPU hotplug.

Returns
the number of logical CPU cores available, -1 if failed to detect.

Definition at line 881 of file mhd_tool_get_cpu_count.c.

References mhd_tool_get_proc_cpu_count(), mhd_tool_get_sys_cpu_count_special_api_(), mhd_tool_get_sys_cpu_count_sysconf_(), mhd_tool_get_sys_cpu_count_sysconf_fallback_(), mhd_tool_get_sys_cpu_count_sysctl_(), and mhd_tool_get_sys_cpu_count_sysctl_fallback_().

Here is the call graph for this function: