Good day.
After calling fork()
we get two processes with absolutely identical address spaces. A long time ago, the BSD system actually allocated the necessary amount of new memory and copied the data of the parent process there during the fork()
call. Now there is copy technology when changing. I am interested in this:
- What exactly is copied when changing? Suppose we called a function in a child process, so at least we wrote something onto the stack. Will the kernel copy one modified page, the entire stack segment, all application segments, or something else?
- How is copying? Is it by-byte? Or the processor can copy for example the whole page for 1 instruction? I've never heard of this ...