leejet / stable-diffusion.cpp

Stable Diffusion in pure C/C++
MIT License
2.91k stars 233 forks source link

Set low priority to process #226

Open SA-j00u opened 2 months ago

SA-j00u commented 2 months ago

with low priority you can free use you PC even with 100% CPU load by SD

grauho commented 2 months ago

This is something that you'd want your OS to handle, either by adjusting the process "niceness" on POSIX with 'nice' or 'renice' if it's already running. If you're on Windows you can supposedly do something similar with the 'START' command.

SA-j00u commented 2 months ago

looks like on windows

#include <windows.h>
SetPriorityClass( GetCurrentProcess(), IDLE_PRIORITY_CLASS);

is enough but i not test it in real software yet