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.
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
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
processidreturned by the
forkcall is the identification of the other, offspring process.
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.