Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the process in linux

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

What is the process in linux? In view of this problem, this article introduces the corresponding analysis and answers in detail, hoping to help more partners who want to solve this problem to find a more simple and feasible way.

Process, in popular terms, is a program in progress, a running program, also known as PCB (process control block)

Under the linux operating system, a process is described by a structure called task_struct, so what does this structure contain?

We all know that to run a program, we must first load the corresponding executable file on disk into memory, so how do we know where it is in memory? At this point, you need to find it through something called a process identifier (pid). Just like us, we have something that represents our identity, that is, identity cards.

After finding out where the program is, if you want to execute it, you must know the corresponding code and the data on which the code depends, so the memory pointer is born. Memory pointers are used to point to the program's code and corresponding data. At this point, the program can be run.

However, because there are many processes, and there is only one CPU CPU, in order to ensure the smooth implementation of many processes, we need to have a sequence of inter-process execution, that is, priority. With priority, it is much easier to implement multiple processes.

But it is worth noting that CPU does not execute one process before executing the next, it will execute the next process after a program has been executed for a period of time, and then execute the follow-up process after the next process has been executed for a period of time. At this point, there will be a problem, what should an unfinished program do when it wants to be executed again in the previous place? Don't worry, we will use "context" to protect the scene.

As mentioned earlier, it takes a program to be executed for a period of time before CPU will continue to execute the next program, so how long does it take for a program to give up CPU? Here we use "accounting information" to record this time.

In addition, many states will appear when the process is executed, such as ready state (R), interruptible sleep state (S), uninterruptible sleep state (D) and so on, so the state of the process will be recorded in the structure. Of course, there is also Icano status information, that is, standard input, standard output, standard error output.

In summary, a structure that describes the process, task_struct, contains the following sections:

● identifier: the id, or pid, used to record the process

● memory pointer: points to program code and related data, etc.

● priority

● context: saves the last execution site of the process at CPU

● accounting information: records when a process should give up CPU

● status: record the relevant status of the process

● IPUBO status information

● signal related information

This is the answer to the question about what is the process in linux. I hope the above content can be of some help to you. If you still have a lot of doubts to be solved, you can follow the industry information channel to learn more about it.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report