Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Some examples for common Real Time processes in Linux

What are some of the common SCHED_FIFO and SCHED_RR processes in Linux? Does user input falls under the cantegory of Real Time processes?

like image 779
EpsilonVector Avatar asked Apr 26 '10 23:04

EpsilonVector


1 Answers

Have a look at this question. "Real time" (for a process) refers to the scheduling algorithm, or the thinking the kernel does when it decides which process gets to run. A real time process will preempt all other processes (of lesser scheduling weight) when an interrupt is received and it needs to run.

A program that just accepts user input is going to go to sleep (block) while waiting for the input, or even between keystrokes (depending). Such a program does not need to have such a high scheduling priority. RT processes should need to run ahead of every other process on the system. This could be because the process is critical to some crucial goal, or high performance timers are needed (in which case, you'd want a real time OS, which standard Linux is not).

Anyway, for an overview of the differences between SCHED_FIFO and SCHED_RR, see the question that I linked. The decision you should be making if contemplating one over the other is not if the program needs to run as RT, thats a fundamental engineering decision. Deciding between the two is just a matter of how you want your process to cooperate with others.

If I was using a standard kernel to control an elevator, the process that serviced hardware interrupts from the micro switches would probably be using SCHED_FIFO at a RT weight. Then again, I probably would not use standard Linux for that.

If I was writing an e-mail client, I'd use the standard scheduler and let the user nice their running programs as they saw fit.

like image 64
Tim Post Avatar answered Oct 07 '22 00:10

Tim Post