如何在c ++中共享fork创建的进程。 [英] how to share processes which is created by fork in c++.

查看:75
本文介绍了如何在c ++中共享fork创建的进程。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何共享由c ++中的fork()创建的进程。

how to share processes which is created by fork() in c++.

推荐答案

您需要在所涉及的进程之间使用某种IPC。

http://en.wikipedia.org/wiki/Inter-process_communication [ ^ ]



每种IPC类型都有正面和负面的,所以请仔细阅读您的选项并根据您的研究实施一个。



编辑:如果您的流程很简单并且不要必须同时运行,你也可以将一个输出管道输送到另一个。这是简单的做事方式。如果他们必须同时运行,你肯定需要某种IPC。
You need to use some sort of IPC between the processes involved.
http://en.wikipedia.org/wiki/Inter-process_communication[^]

Every IPC type has positives and negatives, so read up on your options and implement one based on your research.

If your processes are simple and don't have to run concurrently, you can also pipe the output of one into another. That's the simple way of doing things. If they do have to run at the same time, you definitely need some sort of IPC.


这篇关于如何在c ++中共享fork创建的进程。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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