The difference between a process and a thread
this article from Tortoise Yun-dimensional wuguiyunwei.com
QQ Group: 602183872
650) this.width=650; "Width=" 990 "height=" 495 "src=" https://wuguiyunwei.com/wp-content/uploads/2017/06/ Process-vs-thread-990x495.jpg "class=" Attachment-full size-full wp-post-image "style=" Border:none;vertical-align: middle;height:auto;width:770px; "/>
What is the difference between thread processes and programs?
programs , processes , and threads are the three basic concepts that every computer science engineer must be familiar with operating systems. Here, I'll explain the relationship between each of them, and the difference between them.
What is a program?
A program is an executable file that contains a set of instructions for performing a specific job on a computer. For example,Wuguiyunwei.exe is an executable file that contains a set of instructions that help us Edit and print text files.
The program is not stored in the main memory of the computer. they are stored on a disk or secondary storage on the computer . They are read into the main memory and executed by the kernel . A program is sometimes referred to as a passive entity because it resides on secondary storage.
What is a process?
A process is an execution instance of a program. For example, when you double-click the Notepad icon on your computer, a process that will run the Notepad program starts.
A process is sometimes referred to as the active entity because it resides on main memory and if the system reboots, it leaves memory. Several processes may be related to the same program. For example, you can run multiple instances of a Notepad program. Each instance is called a process.
What is a thread?
A thread is the smallest executable unit of a process. For example, when you run the Notepad program, the operating system creates a process and starts executing the main thread of the process.
A process can have multiple threads. Each thread will have a process of its own task and its own execution path. For example, in a Notepad program, one thread will receive user input and another thread will print the document.
All threads of the same process share the process's memory. Because threads of the same process share the same memory, the communication between threads is fast.
A program is a set of super-processes, and a process is a set of super threads.
QQ Group: 602183872
The difference between a process and a thread