News for hackers. Stuff that matters.
Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by ploxiln on Thursday January 25, 2018 @07:27PM (#16236080)
fork() is a pretty simple way to be able to modify the environment for a process you will spawn. fork(), the child can modify its own environment using various orthogonal system calls, e.g. to redirect stdout/stderr or drop permissions, and then exec the target executable.

Threads throw a wrench in things. But fork() existed for decades before threads. O_CLOEXEC etc helps. Lots of command-line utilities don't use threads.

fork() isn't the fastest way - but in many situations it's not a problem, it's just convenient. In that respect it's somewhat like using python when you could have used go.

Re:How a fix in Go 1.9 sped up our Gitaly service by 30x by jacobvosmaer on Friday January 26, 2018 @05:47AM (#16238238)
Another nice example is changing the working directory for the new process. With fork+exec, you can do a chdir after fork but before exec. With posix_spawn you're stuck with the working directory of the parent.