Fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid
The code I currently work on actually has a use of `clone` with the `CLONE_VM` flag to create something that isn&#x27;t a thread.  Since `CLONE_VM` will share the entire address space with the child (you know, like a thread does!) a very reasonable response would be &quot;WAT?!&quot;<p>What led us here was a need to create an additional thread within an existing process&#x27;s address space but in a way that was non-disruptive - to the rest of the process it shouldn&#x27;t really appear to exist.<p>We achieved this by using `CLONE_VM` (and a handful of other flags) to give the new &quot;thread-like&quot; entity access to the whole address space.  <i>But</i>, we omitted `CLONE_THREAD`, as if we were making a new process.  The new &quot;thread-like&quot; entity would not technically be part of the same thread group but would live in the same address space.<p>We also used two chained `clone()` calls (with the intermediate exiting, like when you daemonise) so that the new &quot;thread-like&quot; wouldn&#x27;t be a child of the original process.<p>All this existed before I joined, it&#x27;s just really cool that it works.  I&#x27;ve never encountered a such a non-standard use of clone before but it was the right tool for this particular job!