Use libcpuid for detect optimal threads count.
This commit is contained in:
parent
0a6d70c499
commit
f329410940
9 changed files with 180 additions and 87 deletions
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue