Soft test process, thread, management process comparison, soft test process thread
In the operating system, I met three brothers, and it seemed like I had been dizzy for a long time. Today I figured it out, so I will dedicate this article to you who are still confused about the three brothers! Because they all have a process, we will inevitably confuse them when we are learning, it is really difficult to explain the three brothers by using what we couldn't fully understand the operating system. So we will use previous knowledge to illustrate it.
Concept comparison
Process: it is the basis of the operating system structure. It is the execution of a program. It is the activity that occurs when a program and its data are executed in sequence on the processing machine.
Thread: the process is used as the resource allocation, and the thread is used as the basic unit for independent operation and independent scheduling. Threads can create and cancel threads to implement concurrent program execution. Generally, a thread has three basic states: Ready, blocked, and running.
Guan Cheng: it defines a data structure and a group of operations that can be performed by concurrent processes. This group of operations can synchronize and change the data in the process.
Image comparison process and thread everyone has had a physical education class. If a physical education class is a large-scale system of a school
ProcessThe thread is all activities in the physical education class. Some people play football, some play basketball, but whether in the Basketball Class or the physical education class, they are part of the physical education class.
ThreadIs a component of the thread. 1. These threads (various activities) share the resources of the process (Playground), and the threads (activities) must depend on the process, there is no meaning after leaving (because skipping classes is wrong ). 2. These threads can be executed synchronously. A process (physical education class) and a thread (physical activity) can be in a class. Of course, you can also take a basketball class first and then play football, they do not have specific time constraints. 3. They rely on code to control the logic sequence. Instead of inserting a thread (activity) in the middle, they rely on code logic (school-class ringtones or teachers) to control it, once the code is incorrect (the school facilities are incorrect), the thread will be in disorder. 4. For the course of physical education, the thread (Sports Activity) is unknown. Only when the school is allocated at the beginning of the school can you determine who is going to take the course first. Guan Cheng
A process defines a data structure and a group of operations that can be performed by a concurrent process, this set of operations can synchronize the process and change the data manager in the management process defines a data structure and a group of operations that can be performed by the concurrent process. This set of operations can synchronize the process and change the data in the management process.
Guan Cheng is like the equipment storage room for physical education. If the process needs to access resources (Sports Equipment), he must first ask for resources (Sports Equipment) through Guan Cheng (equipment room ), after all, things are limited and need to be allocated reasonably based on different situations.
Summary of this knowledge I understand these three, the thread <process, or thread is included in the process, and the tube process controls the process's mental order, who has the resources to run, the thread is to make our process more efficient, and we can't let the students of a school play each other in the playground. This seems too messy.
The relationship between processes and threads in the operating system
A process is like what you are doing... for example, if you are washing dishes... it is a process...
The thread is that you can handle several things at the same time... one thread is that you can only wash one bowl at a time... the dishwasher can wash 10 bowls at the same time and 10 threads...
This should be easy to understand.
What is the relationship between thread processes in the operating system?
Guan Cheng baike.baidu.com/view/1359532.htm
Thread running ke.baidu.com/view/1053.htm
Worker ke.baidu.com/view/19746.htm