In multi-threaded operating system
, each system is implemented differently. In some systems, user-level threads are implemented, and some systems implement kernel-level threads.
1. Kernel-level threads:
(1) Thread creation, revocation, and switching, etc. Both require a direct kernel implementation, ie the kernel knows every thread that is a schedulable entity. (2) These threads can compete for resources throughout the system. (3) A thread control block (TCB) is set in the kernel space for each kernel support thread, and the kernel senses the existence of the thread and controls according to the control block. To some extent, it is similar to a process, except that the overhead of creating and scheduling is smaller than the process. Some statistics are 1:10
2. User-level threads:
(1) User-level threads exist only in user space. ——>Comparing the kernel (3)(2) kernel does not see the user thread. ——> Important differences (3) The allocation of kernel resources is still allocated according to the process; each user thread can only compete for resources within the process.
User threads run on an intermediate system. At present, there are two ways to implement the intermediate system, namely the runtime system (Runtime System) and the kernel control thread. "Runtime system" is a collection of functions that are used to manage and control threads. Functions that include create, undo, thread synchronization and communication, and scheduled functions. These functions reside in user space as an interface between the user thread and the kernel. User threads cannot use system calls. Instead, when a thread needs system resources, it passes the request to the runtime, which gets the system resources through the corresponding system call. Kernel control thread: The system distributes several light processes (LWP) to the process. The LWP can obtain the services provided by the kernel through system calls, and the user threads in the process can be associated with the LWP through multiplexing to obtain the services of the kernel.
The advantages of kernel threads: (1) (2) When there are multiple processors, multiple threads of a process can execute at the same time: (1) scheduling by the kernel
user Advantages of the process: (1) The scheduling of the thread does not require the direct participation of the kernel, and the control is simple. Disadvantages: (1) The resource scheduling is performed according to the process. Under multiple processors, the threads in the same process can only be divided into the same processor. Time multiplexing.
Linux has created a friendly environment that gives us the possibility to choose. For example, most
The web server avoids some unnecessary troubles. You can not display the version information of apa
1. Start/stop/restart of VNC #service vncserver start/stop/restart Close the specific vncserver comm
Computer Store News Microsoft released Windows8 RTM for PC OEMs and manufacturer partners on August
Remote connection in Linux SSH and VNC graphics mode
Xen virtual machine installation practice
Data transmission on the link layer of the linux protocol stack - data reception
How to get the absolute path of the configuration file in Linux
How Linux uses commands to generate bounce SHELL
Eth0: ERROR while getting interface flags: No such device
Linux system management and maintenance -zip/unzip command
Linux Performance Monitoring Common Commands
Install the Linux operating system through the image file on the hard disk
Win10 preview version 10022 screenshot exposure: task view user interface optimized
Win8.1 app store screenshots get bigger
Comparison of the advantages and disadvantages of Apache and IIS Comments
Disable Win8/Win8.1 Modern Lock Screen Function Tutorial
The correct way to install RNDIS driver on win7 system computer
WINDOWS 7 Disk Management Tool Creating and Deleting Partitions
Win7 system sleep setting skills
WP8.1 greatly enhances IE11 web video playback performance
Modify the Windows 7 system registry to improve the startup speed (2)