Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 unix.stackexchange.com ? –  Web-E Jan 29 '13 at 15:56
1  
I think that such priorities differ by distribution. –  laslowh Jan 29 '13 at 15:58

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.