167k views
4 votes
In the original UNIX operating system, a process executing in kernel mode may not be preempted. Explain why this makes (unmodified) UNIX unsuitable for real-time applications.

User Turn
by
4.6k points

1 Answer

5 votes

Answer:

the preemption is -> The ability of the operating

system to preempt or stop a currently

scheduled task in favour of a higher priority

task. The scheduling may be one of, but not

limited to, process or 1/0 scheduling etc.

Under Linux, user-space programs have always

been preemptible: the kernel interrupts user

space programs to switch to other threads,

using the regular clock tick. So, the kernel

doesn't wait for user-space programs to

explicitly release the processor (which is the

case in cooperative multitasking). This means

that an infinite loop in an user-space program

cannot block the system.

However, until 2.6 kernels, the kernel itself was

not preemtible: as soon as one thread has

entered the kernel, it could not be preempted to

execute an other thread. However, this absence

of preemption in the kernel caused several

oroblems with regard to latency and scalability.

So, kernel preemption has been introduced in

2.6 kernels, and one can enable or disable it

using the cONFIG_PREEMPT option. If

CONFIG PREEMPT is enabled, then kernel code

can be preempted everywhere, except when the

code has disabled local interrupts. An infinite

loop in the code can no longer block the entire

system. If CONFIG PREEMPT is disabled, then

the 2.4 behaviour is restored.

So it suitable for real time application. Only

difference is we don't see many coders using it

User Spudwaffle
by
4.6k points