Browse Source

Use cpu_from_thr_id when binding threads.

nfactor-troky
Con Kolivas 14 years ago
parent
commit
debe77767a
  1. 3
      cpu-miner.c

3
cpu-miner.c

@ -642,7 +642,7 @@ static void *miner_thread(void *userdata)
/* Cpu affinity only makes sense if the number of threads is a multiple /* Cpu affinity only makes sense if the number of threads is a multiple
* of the number of CPUs */ * of the number of CPUs */
if (!(opt_n_threads % num_processors)) if (!(opt_n_threads % num_processors))
affine_to_cpu(mythr->id, mythr->id % num_processors); affine_to_cpu(cpu_from_thr_id(thr_id), thr_id % num_processors);
while (1) { while (1) {
struct work work __attribute__((aligned(128))); struct work work __attribute__((aligned(128)));
@ -1284,7 +1284,6 @@ int main (int argc, char *argv[])
sleep(1); /* don't pound RPC server all at once */ sleep(1); /* don't pound RPC server all at once */
} }
applog(LOG_INFO, "%d cpu miner threads started, " applog(LOG_INFO, "%d cpu miner threads started, "
"using SHA256 '%s' algorithm.", "using SHA256 '%s' algorithm.",
opt_n_threads, opt_n_threads,

Loading…
Cancel
Save