Seven process states under Linux

Time:2024-2-7

I. Preface

Hello, everyone, in this article we are going to introduce about the process state under Linux
  • In the previous post, we focused on the topic ofBasic Concepts of Processes under Linux, learned what a process is, how to describe and organize a process, and create a process.
  • In this article, we will first understand the operating system discipline under the state of the process, the state of the process has a basic concept, and then it will go to learn Linux under the seven kinds of process state, to learn the PCB structure in the second member of the variable
task_ struct content classification
  • Identifier: A unique identifier that describes the process and is used to distinguish it from other processes.
  • Status: Task status, exit code, exit signal, etc.
  • Priority: Priority relative to other processes.
  • Program Counter: The address of the next instruction to be executed in the program.
  • Memory pointers: pointers to program code and process-related data, as well as pointers to blocks of memory shared with other processes
  • Context data: data in the processor’s registers while the process is executing [hiatus example, to add map CPU, registers].
  • I/O status information: Includes a list of displayed I/O requests, I/O devices assigned to the process, and files used by the process.
  • Bookkeeping information: may include total processor time, total number of clocks used, time limit, bookkeeping number, etc.
  • Other information

II. Process status under the operating system discipline

  • For the process, it is the concept of the operating system, if you have studied the “operating system” of this discipline, it should be very clear for the process, then there are many states, if the beginning of the new contact partners must feel so many states to distinguish ah!
Seven process states under Linux In fact, there are so many states, the real main ones are just a few, so I will continue to focus on explaining the following kinds of process state

1、Operation status

The first thing we’ll talk about is the [running state], which is the most common
  • First of all for a process, we know that it is composed of theKernel data structures + corresponding code and data So when there are multiple processes in the system, there are bound to be multiple structures; of course, we need to link and organize these processes into
  • Then these processes are in a running queue, if we want to find a process in this queue, we only need to find the head of the process.Then we can dispatch a process accordingly, and put the code and data corresponding to this process to the CPU for execution.
Because each process needs to compete for CPU resources, but it is impossible for the CPU to allocate resources to so many processes at the same time.
  • So each CPU goes about maintaining a run queue with a pointer to the head of the queue insideheadis the [task_struct] of the first process, and the pointer to the end of the queue istailIt points to the last task_struct. So all we need to do to run a process is to put the process pointed to by head on the CPU.
Seven process states under Linux
  • But the CPU can not directly find a need to schedule the process to run, at this point it will need something called [scheduler], the CPU by finding the run queue, run queue to find the scheduler, and then the scheduler and then go to one by one scheduling need to run the process, then at this point all thescheduledin the run queueThese processes are in a state we callOperational status R
Seven process states under Linux
Q: As soon as a process puts itself on the CPU and starts running, does it keep putting itself down until it finishes executing?
  • No, every process has one called:The concept of time slices! Its time is probably around 10 ms. So it’s not that a process is executing all the time, it’s that thisMultiple processes where all code is executed in a single time period — It’s called concurrent execution.
  • So there must be a lot of processes.Action of being put up and taken down by the CPU — It’s called process switching.
So we do not take their own time to feel to measure the CPU, its running again speed is very fast, you simply can not feel the effect of this process switching

2. Blocking state

After introducing the [running state], let’s talk about the [blocking state].
  • For the blocking state, it is actuallyThe process of waiting for some resource to become readyFor example, if your current process initiates an IO request to the operating system, then the process will be suspended and will not be able to continue to run, but this is still too difficult to understand, so let’s take two examples to illustrate
    1. If your network suddenly breaks down, the process can not continue to carry out the task of downloading, at this time it can only be sidelined, the CPU will go to run other processes, and wait for this process is ready to continue to run the process!
    2. Going to the bank’s counter to make a deposit, but when it comes to you suddenly realize that the slip has not yet been printed, so you can only wait on the sidelines.
Both of the above states can be counted as the process being in a blocking state
  • Earlier we were talking aboutBasic Operating System Concepts When the operating system is to manage the underlying hardware, it is said that it needs to perform the action of [first describe, then organize], that is, to abstract this cold hardware into a structure type, the internaltypeRepresents what type of hardware this is,statusrepresents what state the hardware is currently in within the operating system.wait_queueThis is a pointer to the waiting queue.
Seven process states under Linux
  • Then we continue to talk about the operating system in the [process], now there is a process want to read the data in the keyboard, then it needs to hook up with the structure we have just described, because the operating system according to the structure along the architecture to access to the lowest level of hardware needs to be implemented, so the process will need to be in a waiting state, we can chain it into the [wait queue] We can chain it into a wait queue, which is what we just described as await_queue
Then some students may wonder why this is called [waiting queue]? Obviously only one process duck
  • A process can not be considered a queue, if there is another process to read the data in the keyboard, we need to chain it to the waiting queue. At this point, the state of the two processes isblocking state
Seven process states under Linux
  • Then when the keyboard once there is data, we only need to put this process into the [run queue] we said above can be, then the CPU in the scheduling time can automatically go to the underlying device to read; if there is no input when the keyboard, and ultimately our process can only be in each of their respective waiting queues to wait, the process is in the waiting queue is called theblocking state
Seven process states under Linux

3、Suspended state

Finally, let’s talk about a state called [hung state]
  • For the operating system, we know that it is necessary to allocate memory resources for all current processes, in the above I only drew a waiting queue, and only two processes, if a waiting queue exists in more than one process, and through more than one waiting queue in the queue, then the operating system in the memory resources will appear [depleted] the issue of
  • Then the operating system has to ensure that memory resources are saved under normal circumstances
Seven process states under Linux
How are we going to save?
  • As long as a process is not scheduled (running), then the current processCode and Data It’s just idle and unused. So the operating system finds a way to reserve the PCB for the kernel of this process, and then it willCode and Data Re-exchange to the peripheral among the [change out], then at this time there is only one PCB in the queue here, we call the above state of affairspending
Seven process states under Linux
  • When the process is ready, put the process into the run queue, and at that point consider putting theCode and Data Put it back in the process. [Switching in]
Then some students say: why go through with this? What is the point of doing this?
  • A: When the code and data corresponding to a process are exchanged to a peripheral, the OS frees up the corresponding space internally, at which time the OS can re-give this extra space to other processes that need it, thus achieving the purpose of recycling system resources and saving system overhead.
After looking at the three basic process states above we can summarize, if we want to see what state the process is in then generally look at thisWhere processes are queued
  • If it’s in the run queue, it’s in theoperational state
  • If it is in the blocking queue, it is in theblocking state

III. 7 process states under Linux

After the introduction of the three main process states under the operating system discipline, we have a basic concept of the process state, then let us formally learn about the seven process states under the Linux system.
Let’s start by summarizing and reviewing what you’ve learned above:
  1. If the current [operational state], then it needs to be scheduled to run next
  2. If the current [blocking state], then wait for the condition to be ready, and when the device is ready drop the current process into the run queue before it is scheduled to run by the CPU
  3. If the current [pending], all that has to be done is to replace the code and data that was swapped out at that time and re-swap it in, and then include the corresponding process in the run queue
The following is all about the state of the process
static const char * const task_state_array[] = {
"R (running)", /* 0 */
"S (sleeping)", /* 1 */
"D (disk sleep)", /* 2 */
"T (stopped)", /* 4 */
"t (tracing stop)", /* 8 */
"X (dead)", /* 16 */
"Z (zombie)", /* 32 */
};

1. Operational status R

The first thing we’re going to talk about is [Running State R].
  • Take a look at this code below, it’s a dead loop goingprintfPrint Loop Statements
1 #include <stdio.h>
  2 #include <unistd.h>
  3 
  4 int main(void)
  5 {
  6     while(1);                                                                
  7     {
  8         printf("hello bit\n");
  9     }
 10 
 11     return 0;
 12 }
  • Then we run the following code, and when we observe the state of the process, we see that it readsS+But then what the reader wants to see should beR(coll.) be the right thing to do
Seven process states under Linux
  • Next, let’s modify the code a little bit and take a look at it again without using theprintfprint statement now, and it’s straightforward to use awhile(1)Go for the loop.
1 #include <stdio.h>
  2 #include <unistd.h>
  3 
  4 int main(void)
  5 {
  6     while(1);                                                                   
  7     //{
  8     //    printf("hello bit\n");
  9     //}
 10 
 11     return 0;
 12 }
  • Then we see that the state of the process changes when we run it again at this point, and it becomesR+That’s the state of the process we want.
Seven process states under Linux Then some readers are going to ask: why putprintfWhat happens when the print statement is removed?
  • Here’s why.printfPrint statement it is one of the IO streams, for the first time because it is a loop, it keeps waiting for the IO device to be ready, so its process state is alwaysS+which corresponds to the [blocking state] in the operating system; but when we remove theprintfWhat happens after this IO flow, it’s just running pure and simple with no IO, and that also becomes theRstate of affairs

Here’s an additional note on thisSandRback+
  • Here.R+This means that the process is running in the foreground, so it won’t be affected in any way by any commands we type.
Seven process states under Linux
  • Then if we don’t start the process in the normal way, the state of the process will be different, as you can see I’ve done in the./myprochas been added to the end of the&; then its state becomesRThis means that the process is running in the background.
Seven process states under Linux
However, the R state does not mean that the process is running, but that it is in the run queue.

2. Light sleep state S

Let’s move on to the sleep state under Linux S
  • The code we’re going to run below prints a sentence every second
1 #include <stdio.h>
  2 #include <unistd.h>
  3 
  4 int main(void)
  5 {
  6     while(1)
  7     {
  8         sleep(1);                                                                   
  9         printf("hello bit\n");
 10     }
 11 
 12     return 0;
 13 }
  • After running, you can see that the process is in the state ofS+sleep state
Seven process states under Linux Then some students are wondering, isn’t this process running? Why isn’t itRWhat about the status?
  • We can look at the moving image to see that every time we go to check the status of this process, it is in theS+This sleep state. In fact, it has something to do with the difference in speed between the peripherals and the CPU, the CPU that runs extremely fast!
  • Although we can see that the process on the right has been running every second, when we check the status of the process we see onlyS+; because there are99.99%of the time is spent waiting, and only0.01%of time in operation, there is literally an order of magnitude difference between them
Seven process states under Linux
  • However, this does not tell us whether a process is actually asleep, so let’s look at it again with a piece of code.
1 #include <stdio.h>
  2 #include <unistd.h>
  3 
  4 int main(void)
  5 {
  6     int a = 0;
  7     printf("Enter# ");
  8     scanf("%d", &a);
  9 
 10     printf("echo : %d\n", a);
 11     return 0;                                                                         
 12 }
  • Running the process up we can see that it is motivated by theS+state, because [shell] is waiting for user input at this point, and this corresponds to what we talked about above with theblocking state
Seven process states under Linux Seven process states under Linux
  • Not only that, but the likes of the ones we’ve been usingbash, which can also be considered a [blocking state] that keeps waiting for us to enter a command line, and once there it does the reading
Seven process states under Linux Seven process states under Linux

3. Deep sleep state D

In addition to [light sleep], there is also a kind of sleep called [deep sleep], and both of them, both areblocking state
  • For light sleep, the reason why it is called“Shallow.”There is a reason for this: processes in this state are easy to wake up. For example, let’s say that the process we talked about above is in a blocking state, and we use thekill -9 8664Send [signal 9] to this process, then this process is killed, you can also think of it as being woken up
Seven process states under Linux
Okay, I’m going to tell you a story to describe what kind of state this “deep sleep” is.
  • Now there is a process in the operating system, it wants to write data to the disk, the disk this time heard its request, it began to write data, but we know that peripheral devices, especially such devices as the disk is relatively slow, so this time the process will be waiting for a long time!
Seven process states under Linux
  • However, it is not possible to wait indefinitely. Because at this point in time there are already very many processes in the operating system, then the OS it can not see.While passing by, I saw that the current process was waiting and not running, so I terminated it without saying a word
Seven process states under Linux So it, students, we have to understand the reasoning: the operating system that the current system can work then directly let the user to use it, if you can’t bear to replace the page table, really can’t go will kill the process!
  • Then when the process is killed, the disk says: I had a problem writing the data. It goes back to the process that was scheduling it, but it finds that the process is gone? So the disk is embarrassed: what should I do? Write this data should not still put here [the general device will choose to lose]
  • It’s fine if the data is ordinary, but what if it’s the kind of data that’s very important in a bank? What should we do?

An interesting lawsuit.
Because with the loss of this important data, a lawsuit was started.
  • When we get to the courtroom, the judge starts asking questions, interrogating the three suspects, [operating system], [process], and [disk]… Whose problem do the readers think is at fault? Who is the pot in?
Seven process states under Linux
Here are the arguments of the three men.
[OS]:
  • Does it give me the right to manage its hardware and software resources? Did I kill a process under extreme circumstances? Am I fulfilling my role as an operating system? Is it my job to make sure the system doesn’t crash? What does data loss have to do with me?
  • I am doing what my operating system should do, if you convicted me, then ask me the next time I encounter a similar situation, in the end I still do not do, if I do not kill, and ultimately lead to the operating system hang: ① data should be lost or have to lose; ② may also affect other processes. Who will take the responsibility for this?
The judge listened to this statement and thought about it, and he did. So this time he pointed his finger at the disk that had lost the data and asked: Why did you lose the data?
[Disk]:
  • Your Honor, you can’t blame me for this ╮(╯▽╰)╭ In this case I’m an errand boy, people let me do what I do, I’ve told the other side I’m going to fail when I write, I’m going to let him go and wait, I’m going to give it the results of my work pattern has always been like this, and other disks are like this as well
  • If you think I’m guilty, isn’t there something wrong with the other disks as well? I lost it for a reason, other processes had to tell me to write data as well, so I went ahead and wrote it and reported it back, so how come the other disks didn’t have problems?
The operating system listens: Eh, what the bastard said does seem to be no problem. Then the perspective shifted to the side of the victim, i.e., the [process]. Anyway, the operating system is right, the disk is right, then it is your problem!
[Process]:
  • Judge, I’m the victim /(ÊÊÊÊÊÊÊÊÊÊÊ)/~~ I just sat there quietly, “I’m sitting at home, the pot comes from the sky.” I was killed, how can I be at fault?
Then at this time the judge thought about it, and all three of them seem to have a pretty good point, am I wrong?
  • In fact, all three are correct, the operating system fulfilled its duty to kill the process at the critical moment; while the disk played its instinctive duty to lose the data that no one wanted; the process was inadvertently killed by the operating system during the waiting period.
  • When the process is waiting for the disk to write data, it should be protected from being killed by anyone.
Then we have mentioned above that processes that are in [light sleep] can bekilloff, then we have to make the state of this process change to [deep sleep] to be right, i.e.[D]
  • Then since the state of this process is set toDAfterwards, while it was waiting for the disk to be written to, the operating system passed by and saw that the process was not running and waiting, so when it wanted to kill it, it was surprised by this “second to die gold medal”.
Seven process states under Linux
  • Then the process will not be killed, when the disk writes the data to inform the process, then it can put itself into the [run queue] to run, at this time its state becomesRthe
Then at this time there are students asked: D state is so powerful, then if an operating system has a lot of D state, what about this?
  • This student you ask a good question, indeed, this D state then the operating system is no way to kill it, but to wait until the disk writing is complete or what things to perform after the end of its automatically end the process, or in the external power outage, directly unplugged the power supply can be
  • Generally speaking, if there is a D state in a system, the disk pressure in the system is already very big; if there are more than one D state, it means that the system is already very dangerous, and it is better to reinstall the system immediately.

But this one.[D]There’s no way to demonstrate this to the reader here, because D-state processes can only be demonstrated if they are in high IO. If you are interested, you can study the Linux commanddd

4. Stop state T

Okay, let’s talk about [stop state T].
  • First of all, we have to check the corresponding process signals with the following command
kill -l
  • Here we’re going to use signals 18 and 19.
Seven process states under Linux
  • Next, let’s try to see what it would look like to pause and restart the process.
Seven process states under Linux
  • So let’s recap.
    • Suspension of the process
    kill -19 PID
    • priming process
    kill -18 PID
So, if we want to terminate a process, we send signal 19, and if we want it to start up, we send signal 18.
So now I have to ask, what is the difference between this T-stop state and S-sleep state?
  1. Stopped processesIt’s completely suspended.It won’t receive any more signals.
  2. One process can control another through the stopped state.
  3. S and D must be waiting for some kind of resourceThe T state may be waiting for some resource, or it may be controlled by another process.

5. Process tracking status t

Next, let’s talk about the tracking state of the process t. Remember what we learned in the Basics chapter of theGDB Debugging What? – I don’t know.
  • First we look at the state of this process in the normal state, which isSSleep state. Next I did [gdb] debugging, and after hitting a breakpoint on the line, I enteredrOnce it’s running, when we go back to check the status of the process, we see that its status becomestThe reason for this is that the process stopped during debugging
Seven process states under Linux

6. State of death X

What about [Death Status X], this status is just a return status, you won’t see this status in the task list 🙅‍
  1. The first way to kill this process is to send a signal 9 to the process
kill -9 PID
Seven process states under Linux
  1. The second method is to kill this process by its name
killall process name
Seven process states under Linux

7. Deadlock Z — two special processes

Next we will introduce a state called [deadlock state Z], for which we are going to involve two special processes calledzombie process together withOrphan process
But before we talk about this deadlocked state, let’s take a look at thereturn 0This thing.
  • For this I believe the reader learns C by writingmainfunction must have been written, but then why return this0What, you may not be very clear, then now that we have learned the process state under Linux, we can give you to talk about it, the0It’s called an exit code.
Here we write a few lines of code to test
36     int ret = 20;                                                                            
 37     if(ret == 20)   return 0;
 38     else    return 3;
  • We let the process run and then pass theecho $?Went to check the exit code of the current process and found no problem it was0
Seven process states under Linux
  • But at this point if I change the initial value to30If you run it again afterward, you will find that the exit code of the process has changed.
Seven process states under Linux

① Zombie process

The first thing we’re going to introduce is the zombie process, and here’s how to introduce it through a story
  • You, on the other hand, love to run in the morning 🏃‍, and this morning you got up again at 6:00 a.m. to run, and when you passed a park, you met a morning walker [programmer], losing his hair as he ran But then, running, at this point suddenly he was"Snap."Down. Then you are very frightened at this point and immediately call the110and120The phone, and then guarded his side waiting for rescue to come, the surrounding people see also have surrounded, which can not help but some people will be emergency rescue. But after waiting for a while this person did not breathe
Seven process states under Linux
  • After ten minutes or so, the ambulance and police car came, and the police blocked it off first, letting the forensic pathologist come over to examine its condition, and then said, “This person is hopeless, hurry up and notify the family to prepare for the aftermath~.”
Seven process states under Linux
Okay, let’s get back to the point. Let’s talk about this [zombie process].
  • Since the person actually died before the ambulance came, but its state has not been detected yet, and the cause of its death is not currently known, our operating system may maintain this current state, which is theZ-statenamely[Stasis]
So now I’m asking: there’s a process that’s temporarily exited, and it’s going to maintain its state temporarily for a while, and the question is who is it maintaining it for?
  • A: The parent process! When a process exits, it’s the [parent process] that cares the most about it. Because the father process took a lot of effort to the child process!forkIf it suddenly hangs, then the parent process must be concerned about the reason why the corresponding child process exited.
  • But we can’t go through this just with what we’re learning now, and when we get to the laterwait()The system call then goes on to make certain introductions

It’s not enough to describe the above in cold words, so let’s look at it through a real case.
1 #include <stdio.h>
  2 #include <stdlib.h>
  3 #include <unistd.h>
  4 
  5 int main(void)
  6 {
  7     pid_t id = fork();
  8     if(id == 0)
  9     {
 10         // child
 11         int cnt = 5;
 12         while(cnt)
 13         {
 14             printf("I am child, pid: %d, ppid: %d, cnt: %d\n", getpid(), getppid(), cnt);
 15             sleep(1);
 16 
 17             cnt--;
 18         }                                                                                                    
 19         exit(0);
 20     }
 21     else
 22     {
 23         // father   
 24         while(1)
 25         {
 26             printf("I am father, pid: %d, ppid: %d\n", getpid(), getppid());
 27             sleep(1);
 28         }
 29     }
 30     return 0;
 31 }
  • If you run it, you can see that in the first 5s, the parent and child processes are still running at the same time, but when the child process exits at the end of the loop, the parent process is still running and has not exited. However, at this point the parent process is still running and has not exited. So when we look at the state of the two processes on the right hand side, the time has changed somewhat.
Seven process states under Linux
  • Take a closer look at this change of state, where [PID] is5486The parent process is5485At the beginning, they were allS sleep stateBut then the state of the process at the back end becomesZ-stasisThis means that the child process is dead, but the parent process doesn’t know it yet. This means that the child process is dead, but the parent process doesn’t know it yet.
  • This can also be accessed here via this right-hand side<defunct>This one, it means [invalid, no longer exists].
Seven process states under Linux So let’s summarize: When a process generally exits, generally its not immediately and completely.If the parent process does not actively recycle child process information, the child process keeps itself in the Z stateThis is also to make it easier for subsequent parent processes to read the relevant exit results of the child process.
For the above sub-processes, we will call it [zombie process], but this process is there is a certain harm!
  • So a parent process that creates a lot of child processes and just doesn’t recycle them, isn’t that a waste of memory resources? Yes! Because data structure objects themselves take up memory, think about defining a structure variable (object) in C, it is necessary to open up space somewhere in memory!
  • So for the above harm we call it [memory leak], and how to go about avoiding it, will be explained in a later article~

② Orphan process

  • As we mentioned above, when a child process suddenly exits but the parent process does not take the initiative to reclaim it, then the child process will become a [zombie process].
  • Then you can see below that after we terminate the process abruptly, both the parent and child processes are gone
Seven process states under Linux At this point I would like to ask: this parent process suddenly exited, but it’s parent process does not know, then why the parent process is not in the [zombie state].ZWhat about]?
  • Because this process is currentlybashchild processes, when one of them exits, thebashAnd it recycled it. But why is the child process gone? In this case, we need to talk about [orphan processes].

Next, let’s modify the code above to test the zombie process so that the parent process exits before the child process
1 #include <stdio.h>
  2 #include <stdlib.h>
  3 #include <unistd.h>
  4 
  5 int main(void)
  6 {
  7     pid_t id = fork();
  8     if(id == 0)
  9     {
 10         // child
 11         int cnt = 500;
 12         while(cnt)
 13         {
 14             printf("I am child, pid: %d, ppid: %d, cnt: %d\n", getpid(), getppid(), cnt);
 15             sleep(1);
 16 
 17             cnt--;
 18         }
 19         exit(0);
 20     }
 21     else
 22     {
 23         int cnt = 5;
 24         // father   
 25         while(cnt--)                                                                                
 26         {
 27             printf("I am father, pid: %d, ppid: %d\n", getpid(), getppid());
 28             sleep(1);
 29         }
 30     }
 31     return 0;
 32 }
  • Then through the process state tracking to see, we observed that at the beginning of the two parent processes and the child process is synchronized in the walk, but then after a while the parent process terminated, only the child process is still running, at this time we need to pay attention to not the process state, but the child process of thePPIDi.e., the parent process’sPIDIt has changed from [19956] to [1], why is that?
Seven process states under Linux
  • The words here should be popularized for the readers, for thePIDA process with a value of 1 is generally referred to as a [system process]. We can use this command to find out
ps ajx | head -1 && ps ajx | grep systemd
  • Then we see this [system process] ofPIDi.e. 1
Seven process states under Linux
So why does the above happen? Did the child process suddenly switch parents?
  • For the parent-child process, if the parent process ends before the child process, then the child process will be called [orphan process], for the orphan process, it will have the No. 1 process that is [the system process] adopted, because at this time the process does not have a parent process, so someone needs to lead it!
But why was this orphan process adopted?
  • In fact, it is very simple, since it is a process, it will eventually have to exit, but without the father it will have to be maintained by the system process.

Then we can actually explain the above.
  • When this parent process exited, it was exited by thebashFor the children of the parent process, as we have just mentioned, if the parent process of a process ends before the child process, then at this moment the child process immediately becomes an [orphan process], adopted and recycled by the system, so we can’t see the
Seven process states under Linux

IV. Summarizing and refining

Finally to summarize what we have learned in this article
  • In this article, we have covered two major points, one is some of the process states that are common in operating systems, they are:Running, Blocked, Hanging status
    • The state of the scheduled processes that are in the run queue is called theOperational status R
    • The state of a process that is in a wait queue while waiting for the corresponding process of a peripheral is called aBlocking state R
    • When the data and code of a process are exchanged back to the peripheral, the process is in a state we callSuspended state R
  • Moving on, we covered the seven process states under Linux, which are:Running state R, light sleep state S, deep sleep state D, stopped state T, process tracking state t, dead state X, frozen state Z
    • When a process is not waiting for an IO stream, it is in theOperational status R
    • utilizationsleep()function works well to keep a process inLight sleep state S
    • If you don’t want a process to be killed by the operating system while waiting for a disk operation, you can leave it in theDeep sleep state D
    • A [19] signal can be sent to a process to pause it, in aStop state TContinuing to send the [18] signal will restart it.
    • Running a breakpoint in the [gdb] environment puts it in theProcess tracking status t
    • utilizationkill -9 PIDIt is possible to kill a process that is inDeath state X
    • If a child process is allowed to exit when the parent process is not aware of it, it will be in theRigor mortis ZIf the parent process exits before the child process, the child process will become an orphan process.
This is all that is going to be presented in this article, thank you for reading!
Seven process states under Linux

Recommended Today

JavaWeb Framework: Introduction to Spring MVC

Spring MVC summarize summarize MVC (Model View Controller), as a design pattern for layered development of applications. Spring MVCSpring MVC provides a front-end controller DispatcherServlet to dispatch requests , and then through the configuration of the handler mapping , view parsing , etc., to make the MVC pattern development more efficient . Spring MVC five […]