Real-time processes differ from normal processes in one essential way: If a real-time process exists in the system and is runnable, it will always be selected by the scheduler — unless there is another real-time process with a higher priority.

The two available real-time classes differ as follows:

□ Round robin processes (sched_rr) have a time slice whose value is reduced when they run if they are normal processes. Once all time quantums have expired, the value is reset to the initial value, but the process is placed at the end of the queue. This ensures that if there are several sched_rr processes with the same priority, they are always executed in turn.

□ First-in, first-out processes (sched_fifo) do not have a time slice and are permitted to run as long as they want once they have been selected.

It is evident that the system can be rendered unusable by badly programmed real-time processes — all that is needed is an endless loop whose loop body never sleeps. Extreme care should therefore be taken when writing real-time applications.32

Continue reading here: Data Structures

Was this article helpful?

0 0