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的妈妈聊天...