On Linux you might try
uses UTF8Process;
var
cores: integer;
begin
cores := GetSystemThreadCount;
function GetSystemThreadCount: integer; // guess number of cores
I am trying to compile this with FPC 3.0.0 and Lazarus 1.0.10 and I get an error:
PPU Loading /usr/lib/lazarus/1.0.10/lcl/units/x86_64-linux/utf8process.ppu
PPU Invalid Version 135
get_cores.pp(5,5) Fatal: Can't find unit UTF8Process used by get_cores
Fatal: Compilation aborted
Error: /usr/local/bin/ppcx64 returned an error exitcode
I assume that the Lazarus 1.0.10 unit is not compatible with the 3.0.0 compiler, but I am wondering what took place to make it incompatible.
I was able to compile the UTF8Process unit with 2.6.2 FPC, but it says it can't find GetSystemThreadCount, and looking at
/usr/lib/lazarus/1.0.10/lcl/utf8process.pp
I don't see that routine.