/* forktest.c */ //Adapted from http://www.tjhsst.edu/~dhyatt/supercomp/n402.html #include #include #include #include int main(int argc, char** argv) { char name[10]; FILE *outfile; unsigned int pnum, i, j, pid, start, finish; double b=1, c=1; int nproc; int pipes[2]; int value; // srand(time(0)); pipe(pipes); if (argc > 1) nproc = atoi(argv[1]); else nproc = 2; // nice(5); // The command "nice" will run the program at a lower priority printf("Number of processes = %d\n", nproc); for(pnum=0; pnum