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:
parent
c784413cd9
commit
3c3b384c80
1 changed files with 10 additions and 0 deletions
|
@ -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, ¶m);
|
||||
}
|
||||
|
||||
if (pledge("stdio proc recvfd sendfd accept rpath exec unix cpath fattr", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
return 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue