-------Android Training, Java training, look forward to communicating with you! ---------
Let's start by talking about the differences between processes and threads:
Process: Each process has its own code and data space (process context), and there is a significant overhead of switching between processes, and a process contains 1--n threads.
Threads: The same class of threads share code and data space, each thread has a separate run stack and program counter (PC), and thread switching overhead is small.
Threads and processes are divided into five phases: Create, ready, run, block, terminate.
Multi-process means that the operating system can run multiple tasks (programs) at the same time.
Multithreading refers to the execution of multiple sequential streams in the same program.
"Dark Horse Programmer"-java Basic Learning-multithreading