Kernel-level threads and user-level threads

Source: Internet
Author: User

Kernel-level threads and user-level threads

When I wrote this blog these two days, I reviewed the operating system materials and encountered a problem that I did not understand before, that is, about kernel-level threads and user-level threads. After reading some documents, I will share my personal profile.

Threads have been implemented in many systems. By then, the implementation methods of various operating systems are different.

KST:

The kernel supports the implementation of threads in the core space. The kernel sets a thread control block for each thread in the core space, the information used to register the thread identifier, register value, status, priority, and other information. All operations on the thread, such as creation, undo, and switch, all are completed by the corresponding handler in the kernel through system function calls. The system that sets the kernel to support threads is scheduled in the thread unit.

Advantages:

ULT:

User-level threads exist only in user space and have nothing to do with the kernel. In terms of the kernel, it only manages conventional processes-single-threaded processes, but does not perceive the existence of user-level threads; each thread control block is set in the user space, and all operations on the thread are also completed by functions in the thread library in the user space, without the help of the kernel; if a user-level thread is set for a system, the scheduling is still in process units.

Combination Method:

The kernel supports the establishment, scheduling, and management of multiple KST threads. At the same time, user applications are allowed to create, schedule, and manage user-level threads. Some Kernel support threads correspond to multiple user-level threads, programmers can adjust the number of threads supported by the kernel based on application needs and machine configurations to achieve better results.

Comparison:

(1) Kernel support

(3) scheduling and thread execution time

(5) system call

Many of them are copied from the CC ppt. I hope it will help!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.