Quantcast
Channel: How do I make a skewed tree using fork() in C? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Answer by Carl Norum for How do I make a skewed tree using fork() in C?

$
0
0

This seems like the normal use of fork(), basically. Here's some pseudocode:

// start in process 3
int pid = fork();
if (pid == 0) {
   int pid2 = fork();
   if (pid2 == 0) {
       // process 1
   } else {
       // process 2
   }
} else {
   // process 3
}

Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>