Believe that you will often hear the thread or process two concepts, we first look at the process
What is a process? process, as the name implies, is an ongoing program, or it can be said to be a running program.
Ctrl+alt+delete three keys together press, see Windows Task Manager (in fact, a program crashes often in this way to close the program) we can see:
You can find that your computer runs multiple processes at the same time. Previously a single-core computer, the CPU can only respond to one service at a time.
So why can you run multiple processes at the same time? play Music at the same time, write programs, and run code in the background ...
The CPU usage record shows that the 1,2,3,4 indicated in the figure refers to the computer four core meaning that the CPU can respond to four requests at the same time. Running multiple threads at the same time in a single program accomplishes different tasks, called multithreading. Multithreading is primarily designed to conserve CPU time.
So back to the first question, what is a thread?
A program has at least one process, and a process has at least one thread . A thread is the least-executed unit of a process.
In summary, each program starts with at least one process to start, and at least one thread is started per startup process.
My humble research, more superficial, the shortcomings of the Please enlighten me. Thank you!
"Multithreading" simple comprehension & Process and "How many cores is your computer?" 】