4 ms·
> 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
by ttoinou 4y 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 ?
- ehvatum 4y agoUse a shared memory region. For example: https://github.com/erikhvatum/py_interprocess_shared_memory_blob https://github.com/erikhvatum/py_interprocess_shared_memory_...
- masklinn 4y ago> 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.
- ttoinou 4y agoOfc I read that. I think a "only" was missing in the sentence, hence the confusion
- cryptonector 4y agoposix_spawn or vfork+exec