What priority to use calling sched_setscheduler
By Daniel Rodriguez •
I am writing a server that I do not want preempted by any other user process or "low priority" kernel process. I'm using code like this:
struct sched_param sched_param;
memset(&sched_param, 0, sizeof(sched_param));
sched_param.sched_priority = SOME_PRIORITY;
if(-1 == sched_setscheduler(0, SCHED_FIFO, &sched_param)) { // ...My problem is that when I set SOME_PRIORITY to be 99 (the max value), it appears that I starve out even the scheduler process, and my system quickly becomes unusable (the server process has a busywait loop at its core--I have no control over tihs aspect, it's a third party library).
So my question is, what value for SOME_PRIORITY can I use to only allow preemption by the scheduler (and possibly some small subset of kernel services)?
2 Reset to defaultKnow someone who can answer? Share a link to this question via email, Twitter, or Facebook.
More in general
"Zoraya ter Beek, age 29, just died by assisted suicide in the Netherlands. She was physically healthy, but psychologically depressed. It's an abomination that an entire society would actively facilitate, even encourage, someone ending their own life because they had no hope. Th…"