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] _______________________________________________ fpc-devel maillist - [email protected] http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-devel
