Some of the reasons that come to my mind when searching for options. Kernel mode vs user mode:
1) When special processing is required, and we want to use utilities created in the OS. For example: if we were designing an IO server. Here the delay is 1-5 ms. Unable to wait for context switches due to kernel mode tradeoffs. But if you need to rely on the TCP IP infrastructure defined by the kernel. It should be implemented in kernel mode, closely linking the network structure / TCP / IP and the intended transport infrastructure.
2) If you want to completely create a planning structure. Although this is intuitively available using various system calls and pthread frames. However, if your product / threads fully owns the processor, then there are cases of deadlocks or livelocks that you might want to recover. In such scenarios, you will need a structure that takes into account the time spent by each thread. This cannot be done from a custom lan, and therefore requires support for the kernel scheduler / schedule subsystem.
3) If you want to overload memory access, again in environments where resources are designed for specific operations. It makes sense to overlay physical / kernel memory on virtual threads.
4) If you want to virtualize disk access either to add redundancy or to increase read / write performance.
There could be many reasons, but the main reason:
1) Whenever you want to cut layers for performance, you go to the kernel. Because the kernel adds a virtualization infrastructure for fair sharing of resources (CPU, RAM, network, disk).
2) Whenever you want to use the kernel infrastructure for use, which are difficult to port to a user lan (Tcp / ip or shceduler).
Divyank shukla
source share