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