1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:27:44 +00:00

SystemMonitor: Boost main thread priority to maximum on startup

It's frustrating when the system is under heavy load and you want to
investigate using SystemMonitor, but SystemMonitor chokes on the lag.

Let's at give it a fighting chance by maxing out the main thread prio.
This commit is contained in:
Andreas Kling 2021-05-13 20:26:20 +02:00
parent c784413cd9
commit 3c3b384c80

View file

@ -93,6 +93,16 @@ static bool can_access_pid(pid_t pid)
int main(int argc, char** argv)
{
{
// Before we do anything else, boost our process priority to the maximum allowed.
// It's very frustrating when the system is bogged down under load and you just want
// System Monitor to work.
sched_param param {
.sched_priority = THREAD_PRIORITY_MAX,
};
sched_setparam(0, &param);
}
if (pledge("stdio proc recvfd sendfd accept rpath exec unix cpath fattr", nullptr) < 0) {
perror("pledge");
return 1;