[fpc-devel] make -j for windows, number of cores?

Mark Morgan Lloyd markMLl.fpc-devel at telemetry.co.uk
Sun Mar 16 10:22:47 CET 2014

Reinier Olislagers wrote:

> 2. I intend to detect the number of logical cores as per
> http://wiki.lazarus.freepascal.org/Example_of_multi-threaded_application:_array_of_threads#1._Detect_number_of_cores_available.
> and run that many jobs. Is that a good idea?

That's non-portable, even on Linux. There's a syscall which returns a 
bit vector of available CPUs, you need to count those bits since the 
layout might be sparse.

qqv taskset(1), sched_setaffinity(2), sched_getaffinity(2)

Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

More information about the fpc-devel mailing list