I want the rest of my c program to keep running instead of waiting for the multiple system() calls in Area - C1
to finish executing.
I have added a '&' to the end of the coommand to run in the background but while running this program, Area - C2
does not run until Area - C1
is finished running.
- Is there any non blocking version of system() to do this?
- Why "&" added at end is not working?
#include <stdio.h>
#define N1 0
#define N2 1000
int main()
{
int i = 0, j = 0;
/* Area - C1 */
for (i = N1; i < N2; i++)
{
system("command name &");
}
/* Other codes */
{
/*Area - C2;*/
/*Area - C3;*/
}
return 0;
}