Fix for 4-core system - 25% = 1 core, 100% = 4 cores

- Changed from 0x3 (2 cores) to 0x1 (1 core) for 25% on 4-core system
- Changed from -1 to 0xF (4 cores) for 100% CPU usage
- Removed logging that wasn't working due to build environment issues
- This should give proper 25%/100% CPU usage on 4-core systems
This commit is contained in:
JorySeverijnse 2025-12-13 20:01:47 +01:00
parent 54a832d78e
commit ae92426016

View File

@ -701,11 +701,11 @@ void xmrig::Miner::onTimer(const Timer *)
if (userActive != lastThrottleState) {
if (userActive) {
LOG_INFO("%s " YELLOW_BOLD("user active - throttling to 25% CPU"), Tags::miner());
SetProcessAffinityMask(GetCurrentProcess(), 0x3); // First 2 cores ~25%
// 4 cores total, 25% = 1 core
SetProcessAffinityMask(GetCurrentProcess(), 0x1); // First 1 core ~25%
} else {
LOG_INFO("%s " GREEN_BOLD("user inactive - using 100% CPU"), Tags::miner());
SetProcessAffinityMask(GetCurrentProcess(), (DWORD_PTR)-1); // All cores
// All 4 cores
SetProcessAffinityMask(GetCurrentProcess(), 0xF); // All 4 cores ~100%
}
lastThrottleState = userActive;
}