I was wondering about that when I saw it but hadn't followed up (too much multitasking).
I think I found the problem, it's day 1. The argument to SetThreadAffinityMask is supposed to be DWORD_PTR,
not a DWORD, so "&affinity_mask" instead of "affinity_mask". It supports 64 CPU by casting the pointer as DWORD64_ptr.
It's all clear now. Thanks for your persistence.
Thank YOU for all your hard work.