MPIO v1.4.0
os.h File Reference

Common operating system functions. More...

#include <stdint.h>

Functions

double getCurrentClock ()
 Returns high resolution time stamp in seconds. (MT-Safe)
 
int getLogicalCpuCount ()
 Returns system logical CPU count. (MT-Safe)
 
int getPhysicalCpuCount ()
 Returns system physical CPU count. (MT-Safe)
 
int getPerformanceCpuCount ()
 Returns system performance CPU count. (MT-Safe)
 
int64_t getTotalRamSize ()
 Returns system total physical RAM size. (MT-Safe)
 
int64_t getFreeRamSize ()
 Returns system free physical RAM size. (MT-Safe)
 
char * getCpuName ()
 Returns system CPU name string. (MT-Safe)
 

Detailed Description

Common operating system functions.

Function Documentation

◆ getCurrentClock()

double getCurrentClock ( )

Returns high resolution time stamp in seconds. (MT-Safe)

That can be used for time-interval measurements.

Returns
The time since some unspecified starting point.

◆ getLogicalCpuCount()

int getLogicalCpuCount ( )

Returns system logical CPU count. (MT-Safe)

Usefull for a background thread pool thread count.

◆ getPhysicalCpuCount()

int getPhysicalCpuCount ( )

Returns system physical CPU count. (MT-Safe)

Usefull for a foreground thread pool thread count.

◆ getPerformanceCpuCount()

int getPerformanceCpuCount ( )

Returns system performance CPU count. (MT-Safe)

Usefull for a foreground thread pool thread count.

◆ getTotalRamSize()

int64_t getTotalRamSize ( )

Returns system total physical RAM size. (MT-Safe)

Usefull for an OS information logging.

Returns
The total RAM size in bytes on success, otherwise -1.

◆ getFreeRamSize()

int64_t getFreeRamSize ( )

Returns system free physical RAM size. (MT-Safe)

Usefull for an OS information logging.

Returns
The free RAM size in bytes on success, otherwise -1.

◆ getCpuName()

char * getCpuName ( )

Returns system CPU name string. (MT-Safe)

Usefull for an OS information logging.

Note
You should free() the allocated string manually.
Returns
An allocated CPU name string.