What is a process: the common explanation is that a process is a single execution of a program, and what a thread is, a thread can understand as a fragment of a program that executes in a process. The following concepts in a multitasking environment can help us understand the differences between the two:
The process is independent, which is manifested in the memory space, the context, and the thread running within the process space.
In general (do not use special technology) process is unable to break through the process boundary to access the storage space in other processes;
Two segments of code in the same process cannot be executed at the same time unless the thread is introduced. The
thread is a process, and the threads generated by the process will be forced to exit and clear when the process exits. The
thread consumes less resources than the process consumes.
Processes and threads can have a priority.
A process is also a thread in a threaded system. The process can be understood as the first thread of a program.