Differences between processes and threads

xiaoxiao2021-03-06  38

The processes and threads are basic units operating by the program experienced by the operating system, and the system utilizes the basic unit to realize the concurrency of the application. The difference between processes and threads is:

In short, a program has at least one process, and a process has at least one thread.

The division scale of the thread is less than the process, so that the multi-threaded program is high.

In addition, the process has an independent memory unit during the execution process, and multiple threads share memory, which greatly improves the operational efficiency of the program.

Threads are still distinguished from the process during execution. Each stand-alone thread has a program running, sequential execution of sequences and programs. However, the thread cannot be executed independently, and must be performed by the application, and multiple thread execution control is provided by the application.

From a logical point of view, the meaning of multi-thread is in an application, and multiple execution portions can be executed simultaneously. However, the operating system does not see multiple threads to do multiple independent applications to implement process scheduling and management and resource allocation. This is an important difference between the processes and threads.

Hyper thread speeds up Linux speed

转载请注明原文地址:https://www.9cbs.com/read-74630.html

New Post(0)