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:
4
xmrig.c
4
xmrig.c
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user