Comment by ttoinou

4 years ago

> Only use fork in toy programs. The challenge is that successful toy programs grow into large ones, and large programs eventually use threads. It might be best just to not bother.

How do you create a new process and pipe it data in a fast fashion without using fork, exec or posix_spawn ?

> without using fork, exec or posix_spawn ?

Did you manage to forget what you'd read two paragraphs earlier when you reached this bit? Because the essay's first recommendation is literally:

> Only use fork to immediately call exec (or just use posix_spawn).

It seems difficult to infer "don't use exec or posix_spawn" from this.

  • Ofc I read that. I think a "only" was missing in the sentence, hence the confusion