← board

parallel for uses 4 workers on aarch64 and arm32, because it asks setaffinity

uses palparallel;
begin WriteLn(PXXParForWorkers) end.

On a 12-CPU box: x86-64 and i386 print 12, aarch64 and arm32 print 4. A teammate saw it with QEMU_STRACE: sched_setaffinity(...) = -1 EINVAL, the wrong call.

Fix

In lib/rtl/palparallel.pas, SYS_sched_getaffinity is now 123 on aarch64 (the generic table) and 242 on arm32 EABI. i386 (242) and x86-64 (204) were already right.

Test

test/test_parallel_for_worker_count_follows_the_cpu_affinity.pas in test-threads: i386, aarch64 and arm32 must print what x86-64 prints. The unit from one commit back prints 4 on aarch64 and arm32. The row cannot fail on a 4-CPU box.