title: fork call not executing child code
body: <p>Here is my updated code snippet</p>
  
  <pre><code>for (int i=0; i&lt;30; i++){
  
          printf("Forking\n");
  
          tmpPid = fork();
  
          switch(tmpPid)
  
         {
           case -1:
  
              printf("Error");
              break;
           case 0:
  
            printf("Fork success for proc %d\n", i);
            //call some function
             _exit(0)
             break;
  
           default:
  
           printf("Fork succeed");
           //store the pid in a vector
            break;
      }
  }
  
  //iterate through the vector and wait on each process.
  // waitpid(vectorList[i], &amp;exitStatus, WNOHANG)
  </code></pre>
  
  <p>Forking of almost 15-18 child process works fine. But for some process, the child code is not executed at all and the child process just hangs. (i,e fork() only returns child id but not zero). 
  If i buy more time inside the for loop by calling some other dummy functions, then this problem is not seen.
  Can anyone tell me whats the problem ? Is it necessary to put delay between multiple forks ?</p>
  
  <p>Thanks </p>