- Wrap DLL functions and DllMain in #ifdef _WIN32 in xmrig.cpp
- Fix Miner.cpp syntax by removing duplicate lines
- Windows throttling code now only compiles on Windows
- Linux builds should work without Windows-specific code
- Wrap throttling logic in #ifdef _WIN32 blocks in Miner.cpp
- Remove Windows-specific includes from Worker.cpp and CpuWorker.cpp
- Restore Worker.cpp to original platform-neutral state
- Throttling now only compiles on Windows, Linux builds should work
- Use GetSystemInfo() to detect actual core count dynamically
- Calculate 25% of cores: max(1, totalCores / 4)
- Create affinity masks dynamically: (1ULL << coresToUse) - 1
- Handle systems with 64+ cores using (DWORD_PTR)-1
- Works on 4, 8, 16, 32+ core systems automatically
- 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
- Add proper xmrig namespace for setThrottlingState function
- Fix global variable declarations
- This should resolve linking errors from previous build
- Add global throttling state for workers to access
- Modify Worker.cpp to respect throttling when setting thread affinity
- Store original affinity and apply 25% when throttled
- Add detailed logging to see what affinity values are being set
- Remove process-level affinity in favor of thread-level control
- This should fix conflicts between process and thread affinity
- Remove affinity setting from worker threads (causing conflicts)
- Add Windows API affinity control to Miner.cpp timer
- Centralized location prevents multiple threads fighting over affinity
- Set 25% cores when active, 100% when inactive
- Add windows.h include for SetProcessAffinityMask
- Add static lastThrottleState to track state changes
- Only call SetProcessAffinityMask when m_isThrottled != lastThrottleState
- This prevents constantly setting 25% affinity every loop
- Should now properly switch between 25% and 100% based on inactivity
- Calculate 25% of total cores instead of hardcoded 2 cores
- Use std::max(1u, totalCores / 4) to ensure minimum 1 core
- Build affinity mask dynamically for calculated cores
- This should fix stuck at 50% issue and scale properly
- Use SetProcessAffinityMask directly instead of sleep approach
- Limit to first 2 cores (0x3) when user active ~25% usage
- Use all cores (-1) when user inactive
- Add windows.h include for Windows API
- This matches the working implementation approach
- Increase sleep from 300ms to 900ms to ensure actual throttling
- This should create more noticeable CPU usage reduction
- Simple approach: sleep most of the time, work briefly
- Move sleep from before hashing to after hashing completion
- Increase sleep to 300ms to achieve ~25% CPU usage
- This ensures actual work gets done before throttling delay
- Sleep now happens after m_count increment where hashing is complete
- Remove process affinity changes that weren't working
- Use 100ms sleep to achieve ~25% CPU usage when active
- Simplify throttling logic to be more reliable
- Keep 60-second idle threshold and 5-second check interval
- Change idle threshold from 5 minutes to 60 seconds
- Calculate 25% of total cores instead of hardcoded 2 cores
- Update logging message to reflect 25% usage
- Add algorithm include for std::max function
- Ensure minimum 1 core is always used
- Add throttle-on-active configuration option
- Implement process affinity control for Windows
- Add throttling logic in CpuWorker with 5-second checks
- Add logging for throttling state changes
- Set default throttling to enabled
- Throttles to 2 cores when user is active
- Uses 800ms sleep when throttled to reduce CPU usage
This commit reverts all previous CMake and C++ modifications made during the
attempt to implement automatic CUDA/OpenCL detection.
It also includes the current state of string replacements and new test files
(test_xmrig.cpp, dll_injector.cpp, dll_injectorWORKING.cpp) for debugging
application crashes.
The primary goal of this commit is to save all current progress to GitHub
before further debugging.