当前位置:主页 > 资料 >

Maximum number of Zombie process a system can handle
栏目分类:资料   发布日期:2017-05-28   浏览次数:

导读:本文为去找网小编(www.7zhao.net)为您推荐的Maximum number of Zombie process a system can handle,希望对您有所帮助,谢谢! or Defunct Process are those Process which has completed their execution by exit() system call

本文为去找网小编(www.7zhao.net)为您推荐的Maximum number of Zombie process a system can handle,希望对您有所帮助,谢谢!

www.7zhao.net



or Defunct Process are those Process which has completed their execution by exit() system call but still has an entry in Process Table . It is a process in terminated state.

本文来自去找www.7zhao.net

When child process is created in UNIX using fork() system call, then if somehow parent process were not available to reap child process from Process Table, then this situation arise. Basically, Zombie Process is neither completely dead nor completely alive but it has having some state in between.

copyright www.7zhao.net

Since, there is an entry for all the process in process table , even for Zombie Processes . It is obvious that size of process table is Finite . So, if zombie process is created in large amount, then Process Table will get filled up and program will stop without completing their task.

去找(www.7zhao.net欢迎您

Here, our task is to find out Maximum Number of Zombie Process created so that Program will not stop its execution . Approach for this problem is create zombie process within a loop and count it until program do not stop execution. www.7zhao.net

Below is the implementation in C of above idea :

copyright www.7zhao.net

// C program to find number of Zombie processes a 
// system can handle.
#include<stdio.h>
#include<unistd.h>

int main()
{
    int count = 0;
    while (fork() > 0)
    {
        count++;
        printf("%d\t", count);
    }
} 
内容来自www.7zhao.net

Output: 内容来自www.7zhao.net

In the image, we can see after 11834 , increment of count get stopped. However, this is not a fixed number but it will come around it. 内容来自www.7zhao.net

Also, it will depend upon system configuration and strength. 内容来自www.7zhao.net

This article is contributed by . If you like GeeksforGeeks and would like to contribute, you can also write an article using or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks. www.7zhao.net

Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.

本文来自去找www.7zhao.net

去找(www.7zhao.net欢迎您


本文原文地址:http://www.geeksforgeeks.org/maximum-number-zombie-process-system-can-handle/

以上为Maximum number of Zombie process a system can handle文章的全部内容,若您也有好的文章,欢迎与我们分享!

去找(www.7zhao.net欢迎您

Copyright ©2008-2017去找网版权所有   皖ICP备12002049号-2 皖公网安备 34088102000435号   关于我们|联系我们| 免责声明|友情链接|网站地图|手机版