A process is an "executing program" and is a dynamic concept. We use the IDE to write a program is static, static programs are compiled to form an EXE file, run up and form a process. Process is not only the code of the program, but also contains the activity information of the program runtime, which is usually represented by the value of the program counter or the contents of the register. We can use Windows Explorer to view basic information about a process.
Characteristics of the process:
- Is the owner of the physical resource.
- Different processes monopolize different program code and data spaces.
- The creation, destruction, and switching processes have very large performance costs.
threads are lightweight processes that produce backgrounds that are determined by the nature of the process itself.
Features of the thread:
- is a lightweight entity that itself does not occupy system resources. The entities of a thread include programs, data, and thread control blocks (TCB, execution stacks, and program counters that provide the basis for their context execution).
- is the smallest unit of CPU time slice allocation.
- can be executed concurrently.
- All threads in the same process share system resources and data space.
[Bit-by-bit. NET] process and thread differences