forking()和CreateProcess() [英] forking() and CreateProcess()
问题描述
forking()和CreateProcess(带有所有必需的参数)对于Linux和WinXP来说分别是同一回事吗?
Are forking() and CreateProcess(with all required arguments), the same thing for Linux and WinXP, respectively?
如果它们不同,那么有人可以用两种情况下的不同来解释这种差异吗?
If they are different, then could someone explain the difference in terms of what happens in each of the two cases?
谢谢
推荐答案
它们在不同的系统上执行不同的操作. CreateProcess
是仅Windows功能,而fork
仅在POSIX(例如Linux和Mac OSX)系统上.
They do different things, and on different systems. CreateProcess
is a Windows-only function, while fork
is only on POSIX (e.g. Linux and Mac OSX) systems.
fork
系统调用将创建一个新进程,并从调用fork
函数的位置开始在父级和子级中继续执行. CreateProcess
创建一个新进程并从磁盘加载程序.唯一的相似之处是最终结果是创建了一个新过程.
The fork
system call creates a new process and continue execution in both the parent and the child from the point where the fork
function was called. CreateProcess
creates a new process and load a program from disk. The only similarity is that the end result is a new process is created.
有关更多信息,请阅读 CreateProcess
和 fork
.
For more information, read the respective manual page on CreateProcess
and fork
.
这篇关于forking()和CreateProcess()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!