btw Spexx, how about affinity when there is 4 cores but 8 threads? How to assign?

Also how you find this 0x7 0xb.. etc.. I am using bin to hex converter to determine that but i am not getting those..

For example what affinity on your 4 cores is 0x7 ?

Hmmm ... well you

**can** run 8 threads on 4 cores but it is less efficient than running 4 threads and your hashrate would turn out lower in total. If I was going to do it just for shits and giggles then I would simply duplicate the appropriate command line(s).

e.g

start /affinity 0x7 minerd etc --threads 1

start /affinity 0x7 minerd etc --threads 1

will run two threads on the same three cores. You could also do start /affinity 0x7 minerd etc --threads 2 but it is less efficient.

The miner code does in fact detect the condition where you have the number of threads set greater than the number of cores and it applies a cpu affinity to each thread, so if you have 4 cores and start minerd --threads 8 it triggers that section of code at runtime.

The number for cpu affinity is a bitmask expressed in hex, so cpu0 is 1, cpu1 is 2, cpu2 is 4, cpu3 is 8, cpu4 is 16, cpu5 is 32, cpu6 is 64 and cpu7 is 128.

Thus, affinity 0x7 (hex 7, decimal 7) is bitmask 1 + 2 + 4 which is cpu0, cpu1 and cpu2.

Similarly, affinity 0xb (hex b, decimal 11) is bitmask 1 + 2 + 8 which is cpu0, cpu1 and cpu3.

Similarly, affinity 0xd (hex d, decimal 13) is bitmask 1 + 4 + 8 which is cpu0, cpu2 and cpu3.

Similarly, affinity 0xe (hex e, decimal 14) is bitmask 2 + 4 + 8 which is cpu1, cpu2 and cpu3.

Similarly, affinity 0x70 (hex 70, decimal 112) is bitmask 16 + 32 + 64 which is cpu4, cpu5 and cpu6.

Similarly, affinity 0xb0 (hex b0, decimal 176 is bitmask 16 + 32 + 128 which is cpu4, cpu5 and cpu7.

Similarly, affinity 0xd0 (hex d0, decimal 208) is bitmask 16 + 64 + 128 which is cpu4, cpu6 and cpu7.

Similarly, affinity 0xe0 (hex e0, decimal 224) is bitmask 32 + 64 + 128 which is cpu5, cpu6 and cpu7.

I must admit that it took me a while to get my head around that and I was sober at the time too