- 论坛徽章:
- 0
|
出于copy on write的考虑,linux主观上是希望子进程能先运行,但是实际的调用顺序并不能得到保证。引用LKD上的一段话:
Back in do_fork(), if copy_process() returns successfully, the new child is woken up and run. Deliberately, the kernel runs the child process first[9]. In the common case of the child simply calling exec() immediately, this eliminates any copy-on-write overhead that would occur if the parent ran first and began writing to the address space.
[9] Amusingly, this does not currently function correctly, although the goal is for the child to run first. |
|