
Max B. answered 04/06/23
University lecturer & senior engineer tutoring Python, other languages
`fork` and `exec` are two functions very commonly used together in systems
programming.
* `fork` makes a copy of your process
* `exec` replaces the current process with a new program
Together they can be used to run another program:
1) `fork` the current process. In the parent process, keep running the original
program ("program A"). In the child process,
2) `exec` the other program ("program B")
After this two-step dance, the end result is one process with program A and one
process with program B.