Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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)?

share|improve this question
more related to ? – Web-E Jan 29 '13 at 15:56
I think that such priorities differ by distribution. – laslowh Jan 29 '13 at 15:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.