fork(2)系统调用创建一个新进程。
prefork模型会为每个请求创建一个新进程。
为了运行ps,bash 会分叉,创建一个新进程;新进程通过使用执行,使其本身得以重生,转化为 ps的一个新的实例。
To run ps, bash forks to create a new process; the new process reincarnates itself using execution, turning into a new instance of ps.
而且,这两个脚本都要小心地使用exec外壳命令,这个命令用一个程序替代另一个程序,但是没有创建新进程。
Also, both scripts are careful to use the exec shell command, which replaces one program with another but does not create new processes.
这是因为在fork调用中创建了一个新进程。
This is because a new process is created within the call to fork.
这是因为在fork调用中创建了一个新进程。
This is because a new process is created within the call to fork.
应用推荐