23

Is fork() older than C? What are its origins? I might think that fork() was created along with C (1970s) but I recently read a reference to a 1963 paper where fork() was mentioned.

1
  • 2
    When learning about fork(), it's also worth exploring BSD's vfork().
    – fadden
    Commented Apr 20, 2018 at 15:35

2 Answers 2

29

The fork() system call is definitely older than the C language because it already existed in the UNIX v0 draft, page 18 of the PDF, when the C language hasn't been conceived yet.

The mechanism was different from what we're used to:

Except while UNIX is bootstrapping itself into operation, a new process can come into existence in only one way: by use of the fork system call.

processid = fork(label)

When fork is executed by a process, it splits into two independently executing processes. The two processes have core images which are copies of each other, but they are not precisely equivalent: one of them is considered the parent process. In the parent, control does not return directly from the fork, but instead passes to location label; in the child process, there is a normal return. The processid returned by the fork call is the identification of the other, offspring process.

4
  • 3
    That looks like an editorial mistake, mixing parent and child – the parent would need the child's processid, not the child, right? Commented Apr 21, 2018 at 11:38
  • @PaŭloEbermann You're most likely right, as the last sentence indicates that the most recent phrase should be about the parent process.
    – Leo B.
    Commented Apr 21, 2018 at 17:12
  • 1
    I don't have any documentation on Multics but could this have been taken from Multics - after all both the Unix (formerly Unics) inventors were previously Multics programmers.
    – cup
    Commented May 1, 2018 at 21:51
  • @cup In a conversation the other day I was told that the concept of forking a process did exist in Multics, but the evolution of the calling convention is of interest as well.
    – Leo B.
    Commented May 2, 2018 at 0:22
23

An article on the history of fork appeared in the IEEE Annals of the History of Computing 2016 vol. 38.

This article states that fork was invented by Melvin Conway in 1962 when considering the allocation of tasks to processors in multi-processor systems.

5
  • The original Conway paper can be found on page 164 of textfiles.com/bitsavers/pdf/afips/1963-11_%2324.pdf
    – dmw
    Commented Nov 10, 2018 at 19:53
  • @dmw Unfortunately, your link gives a 404; any chance you can find an active one? Please?
    – Richard T
    Commented Aug 8, 2022 at 4:14
  • 1
    @RichardT Here you go docdroid.net/oEodAHw/1963-11-24-pdf#page=146
    – dmw
    Commented Aug 9, 2022 at 11:02
  • @dmw I'm VERY appreciative for you providing that link. As it was published less than two weeks before my birth AND as I have spent over 44 years in computing (and am still very active), this is a VERY interesting read! I've downloaded the whole thing and while I really don't have time to read ALL of it, I'd never have found it without your link! THANKS!
    – Richard T
    Commented Aug 10, 2022 at 2:44
  • 1
    @RichardT the lesson is clear.. never delete a PDF you've downloaded once ;) Best wishes, and glad you liked it
    – dmw
    Commented Aug 10, 2022 at 16:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .