1. 17
  1. 3

    For me the takeaway is that fork() isn’t a great abstraction for spawning processes on modern OS’s.

    1. 3

      You might be interested in the paper “A fork() in the road”, from HotOS 2019 (https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf), which argues:

      The received wisdom suggests that Unix’s unusual combination of fork() and exec() for process creation was an inspired design. In this paper, we argue that fork was a clever hack for machines and programs of the 1970s that has long outlived its usefulness and is now a liability. We catalog the ways in which fork is a terrible abstraction for the modern programmer to use, describe how it compromises OS implementations, and propose alternatives.

      As the designers and implementers of operating systems, we should acknowledge that fork’s continued existence as a first-class OS primitive holds back systems research, and deprecate it. As educators, we should teach fork as a historical artifact, and not the first process creation mechanism students encounter.

      1. 1

        Yeah, I was vaguely aware that fork()/exec() was not highly regarded these days. This is a kind of wild practical demonstration of the problems with it though.