Check Your Processor capability using this Simple c Program [Linux] - COFPROG

Check Your Processor capability using this Simple c Program [Linux]

Test your computer capability to findout how many processes it can hold or accomodate

 #include<stdio.h>
#include<unistd.h>

#define MAX 1000

int main()
{
    int i=0;
    int ret;
  
    for(i=0;i<MAX;i++)
    {
        ret = fork();
        if(ret == 0)
        {
            printf("count = %d, PID=%d, PPID=%d\n", i,getpid(),getppid());
          
        }
      
            i++;
    }
        sleep(3);
    return 0;
}




Previous
Next Post »

BOOK OF THE DAY