diff --git a/src/backend/cpu/CpuWorker.cpp b/src/backend/cpu/CpuWorker.cpp index 2bed2a97..9cd2292b 100644 --- a/src/backend/cpu/CpuWorker.cpp +++ b/src/backend/cpu/CpuWorker.cpp @@ -280,24 +280,19 @@ void xmrig::CpuWorker::start() // Apply throttling changes if (wasThrottled != m_isThrottled) { if (m_isThrottled) { - // User is active - throttle to 25% of total cores - const uint32_t totalCores = Cpu::info()->threads(); - const uint32_t coresToUse = std::max(1u, totalCores / 4); - uint64_t affinityMask = 0; - for (uint32_t i = 0; i < coresToUse; ++i) { - affinityMask |= (1ULL << i); - } - Platform::setProcessAffinity(affinityMask); + // User is active - set throttling flag + // No affinity changes needed, we'll use timing-based throttling } else { - // User is idle - use all cores - Platform::setProcessAffinity(static_cast(-1)); + // User is idle - clear throttling flag } } } - // Add sleep when throttled + // Apply timing-based throttling when user is active + // This reduces effective hashrate to ~25% by adding delays if (m_isThrottled) { - std::this_thread::sleep_for(std::chrono::milliseconds(800)); + // Sleep for 75% of the time to achieve ~25% CPU usage + std::this_thread::sleep_for(std::chrono::milliseconds(100)); } const Job &job = m_job.currentJob();