Process Control block: identifier, status, priority, program counter, memory pointer, context data, I/O status information, accounting information
The process control block is a key tool for the operating system to support multiple processes and provide multi-processing. It can be said that the process is composed of program code and related data and process control blocks.
Mode switching differs from process switching in that a pattern switch does not change the state of a process that is in the running state, in which case it requires little overhead to save the context and later restore the context environment.
To perform process management functions, the operating system maintainer describes each process, or process image, which includes the address space of the execution process and a Process control block.
A running process can be interrupted by an interrupt event that occurs outside the process and is recognized by the processor, or by a system call that executes the operating system. In either case, the processor performs a mode switch and transfers the control to the operating system routines.
User-level line threads has two obvious drawbacks for kernel-level threading:
1> in a typical operating system, many system calls can cause blocking. Therefore, when a user-level thread executes a system call, not only will the thread be blocked, but all threads in the process will be blocked.
2> in a purely user-level threading strategy, a multithreaded application cannot take advantage of multi-processing techniques.
You can solve these two problems by writing the application as a multi-process program rather than as a multi-threaded one. Another way to overcome threading problems is to use a technique called jacketing. The goal of jacketing is to convert a blocking system call into a non-blocking system call.
Between a user-level thread and a kernel-level thread, there is a performance gap of more than one level between the kernel-level thread and the process.
If most of the thread switching in your application requires kernel-state access, then the scenario based on a user-level thread will not be much better than a kernel-level thread-based scenario.
Process description and control essay