I've made some more tweaks and this is what I get with -t 8 --cpu-affinity=0x5555
on Linux. I'l wait for your test results on Windows before I commit the change.
Also what is your goal? Why are you going to all this trouble with odd thread counts and
complex affinity masks?
I will do what you ask when I have the chance. I thought the problem was already clear that it would never set affinity to CPU# > 31.
What do you mean by "complex" masks? Why do I have to choose submultiples of the number of processors and why would it be better? In this last example, I set half minus 3. Changing some 5s to 4s in the mask shouldn't be considered "complex". Nor should 8 threads with a mask of 0x40404040404041 (8 throw better performance than 7

). Shouldn't they all work? I'm sure that when "simple" masks work the "complex" ones will follow.
Question: "half threads (28), default affinity": what is a pass in this test? Default affinity always works in that all CPUs are allocated to the process.
I'll send my results back to you by PM in order not to pollute this thread.
Cheers.