1
0
mirror of https://github.com/xmrig/xmrig.git synced 2025-12-10 01:02:40 -05:00

Use libcpuid for detect optimal threads count.

This commit is contained in:
XMRig
2017-05-03 13:48:08 +03:00
parent 0a6d70c499
commit f329410940
9 changed files with 180 additions and 87 deletions

View File

@@ -262,7 +262,7 @@ static void *miner_thread(void *userdata) {
struct cryptonight_ctx *persistentctx = (struct cryptonight_ctx *) create_persistent_ctx(thr_id);
if (cpu_info.count > 1 && opt_affinity != -1L) {
if (cpu_info.total_logical_cpus > 1 && opt_affinity != -1L) {
affine_to_cpu_mask(thr_id, (unsigned long) opt_affinity);
}
@@ -330,7 +330,7 @@ static void *miner_thread_double(void *userdata) {
struct cryptonight_ctx *persistentctx = (struct cryptonight_ctx *) create_persistent_ctx(thr_id);
if (cpu_info.count > 1 && opt_affinity != -1L) {
if (cpu_info.total_logical_cpus > 1 && opt_affinity != -1L) {
affine_to_cpu_mask(thr_id, (unsigned long) opt_affinity);
}