forking()和CreateProcess() [英] forking() and CreateProcess()

查看:80
本文介绍了forking()和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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆