mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 00:15:04 -05:00
Optimized RandomX initialization and switching.
This commit is contained in:
@@ -82,7 +82,9 @@ xmrig::CpuWorker<N>::~CpuWorker()
|
||||
template<size_t N>
|
||||
void xmrig::CpuWorker<N>::allocateRandomX_VM()
|
||||
{
|
||||
while (!Rx::isReady(m_job.currentJob(), m_node)) {
|
||||
RxDataset *dataset = Rx::dataset(m_job.currentJob(), m_node);
|
||||
|
||||
while (dataset == nullptr) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(200));
|
||||
|
||||
if (Nonce::sequence(Nonce::CPU) == 0) {
|
||||
@@ -90,13 +92,6 @@ void xmrig::CpuWorker<N>::allocateRandomX_VM()
|
||||
}
|
||||
}
|
||||
|
||||
RxDataset *dataset = Rx::dataset(m_node);
|
||||
assert(dataset != nullptr);
|
||||
|
||||
if (!dataset) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!m_vm) {
|
||||
m_vm = new RxVm(dataset, m_memory->scratchpad(), !m_hwAES);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user