ftwin 0.8.10
ft_system.c File Reference

Implementation of system-related utility functions. More...

#include "ft_system.h"
Include dependency graph for ft_system.c:

Go to the source code of this file.

Functions

unsigned int ft_get_cpu_cores (void)
 Get the number of available CPU cores on the current system.
 

Detailed Description

Implementation of system-related utility functions.

Definition in file ft_system.c.

Function Documentation

◆ ft_get_cpu_cores()

unsigned int ft_get_cpu_cores ( void  )

Get the number of available CPU cores on the current system.

This function attempts to determine the number of online processors. It serves as a sensible default for setting the number of worker threads.

Returns
The number of CPU cores, or a reasonable fallback (e.g., 4) if detection fails.

Definition at line 33 of file ft_system.c.