mirror of
https://github.com/jwinterm/xmr-stak.git
synced 2026-10-17 05:41:41 +02:00
check if affinity must be set
- check if affinity vale before calling `thd_setaffinity`
This commit is contained in:
@@ -64,8 +64,9 @@ minethd::minethd(miner_work& pWork, size_t iNo, GpuContext* ctx, const jconf::th
|
||||
|
||||
order_guard.wait();
|
||||
|
||||
if(!cpu::minethd::thd_setaffinity(oWorkThd.native_handle(), affinity))
|
||||
printer::inst()->print_msg(L1, "WARNING setting affinity failed.");
|
||||
if(affinity >= 0) //-1 means no affinity
|
||||
if(!cpu::minethd::thd_setaffinity(oWorkThd.native_handle(), affinity))
|
||||
printer::inst()->print_msg(L1, "WARNING setting affinity failed.");
|
||||
}
|
||||
|
||||
extern "C" {
|
||||
|
||||
@@ -110,8 +110,9 @@ minethd::minethd(miner_work& pWork, size_t iNo, bool double_work, bool no_prefet
|
||||
|
||||
order_guard.wait();
|
||||
|
||||
if(!thd_setaffinity(oWorkThd.native_handle(), affinity))
|
||||
printer::inst()->print_msg(L1, "WARNING setting affinity failed.");
|
||||
if(affinity >= 0) //-1 means no affinity
|
||||
if(!thd_setaffinity(oWorkThd.native_handle(), affinity))
|
||||
printer::inst()->print_msg(L1, "WARNING setting affinity failed.");
|
||||
}
|
||||
|
||||
cryptonight_ctx* minethd::minethd_alloc_ctx()
|
||||
@@ -270,7 +271,6 @@ std::vector<iBackend*> minethd::thread_starter(uint32_t threadOffset, miner_work
|
||||
else
|
||||
printer::inst()->print_msg(L1, "Starting %s thread, no affinity.", cfg.bDoubleMode ? "double" : "single");
|
||||
|
||||
// \todo need thread offset
|
||||
minethd* thd = new minethd(pWork, i + threadOffset, cfg.bDoubleMode, cfg.bNoPrefetch, cfg.iCpuAff);
|
||||
pvThreads.push_back(thd);
|
||||
}
|
||||
|
||||
@@ -82,8 +82,9 @@ minethd::minethd(miner_work& pWork, size_t iNo, const jconf::thd_cfg& cfg)
|
||||
|
||||
order_guard.wait();
|
||||
|
||||
if(!cpu::minethd::thd_setaffinity(oWorkThd.native_handle(), affinity))
|
||||
printer::inst()->print_msg(L1, "WARNING setting affinity failed.");
|
||||
if(affinity >= 0) //-1 means no affinity
|
||||
if(!cpu::minethd::thd_setaffinity(oWorkThd.native_handle(), affinity))
|
||||
printer::inst()->print_msg(L1, "WARNING setting affinity failed.");
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user