Introduction僵尸进程就是创建一个子进程并且在主进程结束后依然存在未结束示范代码:#include #include #include int main(){if(!fork()){if(fork()){sleep(30);}}return 0;}RequirementUsing either a UNIX or a Linux system, write a C program that forks a child process that ultimately becomes a zombie process.This zombie process must remain in the system for at least 10 seconds. Process states can be obtained from the command ps -lThe process states are shown below the S column; processes with a state of Z are zombies. The process identifier (pid) of thechild process is listed in the PID column, and tC代写 zombie process代做留学生Matlab程序hat of the parent is listed in the PPID column. Perhaps the easiest way todetermine that the child process is indeed a zombie is to run the program that you have written in the background (using the )and then run the command ps -l to determine whether the child is a zombie process. Because you do not want too many zombieprocesses existing in the system, you will need to remove the one that you have created. The easiest way to do that is toterminate the parent process using the kill command. For example, if the process id of the parent is 4884, you would enterkill -9 4884Upload a video of the program running and you demonstrating the operations. Include a zip of the project as well.转自:http://ass.3daixie.com/2019031022472252.html
讲解:C zombie processMatlab
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- J刚来中心,他和小伙伴发生了冲突,我问他我们还有什么方式可以解决问题?我们可以用沟通的方式进行。今天和J的妈妈聊天...