countProcessors

Syntax

int countProcessors(void)

Arguments

none

Return

Returns the number of physical and/or logical processors on your system, as reported by the Windows GetSystemInfo API.

Description

Lets you know the number of processors you have at your disposal to perform useful work. The process count includes each separate physical cpu, or each core within a multicore cpu, or the two logical cpus within a Hyper-Threaded cpu.

Example

%ffp

OnFilterStart:
{
    int ncpu = countProcessors();

    Info ("This system has %d available processor%s.", ncpu, ncpu==1?"":"s");

    return false;  //continue processing
}

Also see

System Functions, Multithreading Functions, triggerThread, waitForThread, isThreadActive, getThreadRetVal, terminateThread

Comments