Process:

Process is the basic unit of system resource allocation and independent operation.

Process creation, scheduling, running and destruction are all controlled by the operating system, the operating system will be responsible for the process state switch, and this is the management of the process.

Processes create processes, which are called parent processes and child processes. A child process can also create a process, thus forming a process tree. The diagram below:

Before a process is created, a process control block (PCB) is created, and the process control block is responsible for storing the basic information of the process (such as the process’s ID, current state, and relationship with other processes and resources). It is the unique identity of the process, and it lives and dies with the process.

Thread:

Threads are the basic unit of system scheduling. In the same process, multiple threads can be created, and all threads can share the resources allocated by the process.

The difference between process and thread:

Process can be said to be a program, is a macroscopic performance; And a thread is a small step in the process of a process running, is a kind of micro performance. The final result of the process is the result of the execution of these threads.