User:Mayank8133


 * 1) * RE-ENTRANT KERNEL

A reentrant kernel enables processes to give away the CPU while in kernel mode, not hindering other processes from entering kernel modes.

If the kernel is not reentrant, a process can only be suspended while it is in user mode(to be more precise, it could also suspend the process in kernel mode, but would block kernel mode execution on all other processes). The reason for this is that all kernel threads share the same memory and corruption would occur if execution would jump between them arbitrarily.

That is, if the kernel is reentrant, several processes may be executed in the kernel mode at the same time when the process is suspended.

A typical use case is I/O wait. The process wants to read a file. >>When the kernel is not reentrant : It calls a kernel function for this to stop the inside the kernel function. Disk controller is asked for the data. Getting the data will take some time and the function will block during that time.

With reentrant kernel,the scheduler will assign the CPU another process until the interrupt from the disk controller indicates that the data is available and our thread can be resumed.

Hence with this concept, throughput of the system increases rapidly.

A kernel that is not entrant needs to use a lock to makee sure that no two processes are executing in kernel mode at the same time.