Displaying Source Code(s)
|
|
Finding Maximum number of Concurrent processes .
--------------------------------------------------------------------------------
/* Finding Maximum number of Concurrent processes */
# include < stdio.h>
# include < stdlib.h>
# include < unistd.h>
# include < signal.h>
# include < sys/wait.h>
void main()
{
int cnt,pid;
for(cnt=0;;cnt++)
{
pid = fork();
if(pid==-1)
{
printf("Maximum Number Of Concurrent Process Per User %d
",cnt);
}
if(pid!=0)
{
wait(0);
exit(0);
}
}
} |
|
|