|
|
@ -1121,8 +1121,9 @@ static void *miner_thread(void *userdata) |
|
|
|
case 5: |
|
|
|
case 5: |
|
|
|
prio = -15; |
|
|
|
prio = -15; |
|
|
|
} |
|
|
|
} |
|
|
|
applog(LOG_DEBUG, "Thread %d priority %d (set to %d)", thr_id, |
|
|
|
if (opt_debug) |
|
|
|
opt_priority, prio); |
|
|
|
applog(LOG_DEBUG, "Thread %d priority %d (nice %d)", |
|
|
|
|
|
|
|
thr_id, opt_priority, prio); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
int ret = setpriority(PRIO_PROCESS, 0, prio); |
|
|
|
int ret = setpriority(PRIO_PROCESS, 0, prio); |
|
|
|
if (opt_priority == 0) { |
|
|
|
if (opt_priority == 0) { |
|
|
@ -1133,12 +1134,12 @@ static void *miner_thread(void *userdata) |
|
|
|
/* Cpu thread affinity */ |
|
|
|
/* Cpu thread affinity */ |
|
|
|
if (num_cpus > 1) { |
|
|
|
if (num_cpus > 1) { |
|
|
|
if (opt_affinity == -1 && opt_n_threads > 1) { |
|
|
|
if (opt_affinity == -1 && opt_n_threads > 1) { |
|
|
|
if (!opt_quiet) |
|
|
|
if (opt_debug) |
|
|
|
applog(LOG_DEBUG, "Binding thread %d to cpu %d (mask %x)", thr_id, |
|
|
|
applog(LOG_DEBUG, "Binding thread %d to cpu %d (mask %x)", thr_id, |
|
|
|
thr_id % num_cpus, (1 << (thr_id % num_cpus))); |
|
|
|
thr_id % num_cpus, (1 << (thr_id % num_cpus))); |
|
|
|
affine_to_cpu_mask(thr_id, 1 << (thr_id % num_cpus)); |
|
|
|
affine_to_cpu_mask(thr_id, 1 << (thr_id % num_cpus)); |
|
|
|
} else if (opt_affinity != -1) { |
|
|
|
} else if (opt_affinity != -1) { |
|
|
|
if (!opt_quiet) |
|
|
|
if (opt_debug) |
|
|
|
applog(LOG_DEBUG, "Binding thread %d to cpu mask %x", thr_id, |
|
|
|
applog(LOG_DEBUG, "Binding thread %d to cpu mask %x", thr_id, |
|
|
|
opt_affinity); |
|
|
|
opt_affinity); |
|
|
|
affine_to_cpu_mask(thr_id, opt_affinity); |
|
|
|
affine_to_cpu_mask(thr_id, opt_affinity); |
|
|
@ -2299,7 +2300,6 @@ int main(int argc, char *argv[]) |
|
|
|
SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler, TRUE); |
|
|
|
SetConsoleCtrlHandler((PHANDLER_ROUTINE)ConsoleHandler, TRUE); |
|
|
|
if (opt_priority > 0) { |
|
|
|
if (opt_priority > 0) { |
|
|
|
DWORD prio = NORMAL_PRIORITY_CLASS; |
|
|
|
DWORD prio = NORMAL_PRIORITY_CLASS; |
|
|
|
SetPriorityClass(NULL, prio); |
|
|
|
|
|
|
|
switch (opt_priority) { |
|
|
|
switch (opt_priority) { |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
prio = BELOW_NORMAL_PRIORITY_CLASS; |
|
|
|
prio = BELOW_NORMAL_PRIORITY_CLASS; |
|
|
|