Processes and Threads

Source: Internet
Author: User

Process: A process refers to a program that is running. Exactly, when a program goes into memory run,
becomes a process, the process is in the process of running the program, and has a certain independent function.

Thread: A thread is an execution unit (execution path) in a process that is responsible for the execution of the program in the current process,
There is at least one thread in a process. There can be multiple threads in a process,
This application can also be called a multithreaded program.
In short: After a program runs at least one process, a process can contain multiple threads

The concept of deep threading
What is multithreading?
That is, there are multiple threads executing at the same time in a program.
A core CPU switches between multiple threads, and because of the short switching time (milliseconds or even nanosecond level), we don't feel it.

Single-threaded: that is, if more than one task can be executed sequentially. When the previous task finishes executing, the next task begins. such as to Internet cafes, cafes can only let a person online, when this person under the machine, the next person to the Internet.
Multithreaded: That is, if more than one task can be executed at the same time. For example, to Internet cafes, cafes can allow many people at the same time Internet.

Processes and Threads

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: 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.