两个C / C ++程序的交互 [英] Interaction of two c/c++ programs

查看:140
本文介绍了两个C / C ++程序的交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在完全缺乏这种认识。也许这是堆栈太广,但这里有云:

I'm in complete lack of understanding in this. Maybe this is too broad for stack, but here it goes:

假设我有两个程序(用C / C ++)同时运行,比如A和B,具有不同的PID。

Suppose I have two programs (written in C/C++) running simultaneously, say A and B, with different PIDs.

哪些作出然后彼此交互的选项。例如,如何传递信息从一个到另一个像有一个能够等待来自其它的信号,并作出相应的反应。

What are the options to make then interact with each other. For instance, how do I pass information from one to another like having one being able to wait for a signal from the other, and respond accordingly.

我知道MPI,但MPI正常工作对于使用同一源(因此,它比从建互相交流完全不同的方案只是更多的互动并行计算)编译的程序。

I know MPI, but MPI normally works for programs that are compiled using the same source (so, it works more for parallel computing than just interaction from completely different programs built to interact with each other).

感谢

推荐答案

您必须监视为IPC(进程间通信)。有几种类型:

You must lookout for "IPC" (inter process communication). There are several types:


  • 管道

  • 信号

  • 共享内存

  • 消息队列

  • 信号灯

  • 文件(每@JonathanLeffler的建议: - )

  • RPC(由@sftrabbit建议)结果
    这通常是更着眼于客户端/服务器

    • CORBA

    • 的D-Bus

    这篇关于两个C / C ++程序的交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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