1. The purpose of introducing threads and processes
The purpose of introducing processes into the OS is to enable more programs to execute concurrently to increase the utilization of resources and the amount of the system.
Threading is introduced to reduce the time spent by the program in concurrent execution, which is better concurrency for the OS.
2. The difference between a process and a thread
Process is a process of dynamic execution of a program, it needs to undergo a complete process from code load code execution to completion, multi-threaded operating system can run multiple processes at the same time (that is, running programs), because the CPU has a time-sharing mechanism, so each process can be recycled to get their own cup of the chip. Because the CPU executes very fast, all programs seem to run "simultaneously" (jargon is called "concurrency").
A thread is an entity of a process that is the basic unit of CPU dispatch and allocation, which is a smaller unit than a thread that can run independently. A thread does not own system resources at all, it has only a few resources that are essential in the run, but it can share all the resources owned by the process with other threads in the same process.
Java Summary of Multi-threading