• <small id='jzzde'></small><noframes id='jzzde'>

    <i id='jzzde'><tr id='jzzde'><dt id='jzzde'><q id='jzzde'><span id='jzzde'><b id='jzzde'><form id='jzzde'><ins id='jzzde'></ins><ul id='jzzde'></ul><sub id='jzzde'></sub></form><legend id='jzzde'></legend><bdo id='jzzde'><pre id='jzzde'><center id='jzzde'></center></pre></bdo></b><th id='jzzde'></th></span></q></dt></tr></i><div id='jzzde'><tfoot id='jzzde'></tfoot><dl id='jzzde'><fieldset id='jzzde'></fieldset></dl></div>
      <bdo id='jzzde'></bdo><ul id='jzzde'></ul>

        <tfoot id='jzzde'></tfoot>
        <legend id='jzzde'><style id='jzzde'><dir id='jzzde'><q id='jzzde'></q></dir></style></legend>

        C++进程间通信的最佳方式

        时间:2023-09-17
        <i id='XRmFA'><tr id='XRmFA'><dt id='XRmFA'><q id='XRmFA'><span id='XRmFA'><b id='XRmFA'><form id='XRmFA'><ins id='XRmFA'></ins><ul id='XRmFA'></ul><sub id='XRmFA'></sub></form><legend id='XRmFA'></legend><bdo id='XRmFA'><pre id='XRmFA'><center id='XRmFA'></center></pre></bdo></b><th id='XRmFA'></th></span></q></dt></tr></i><div id='XRmFA'><tfoot id='XRmFA'></tfoot><dl id='XRmFA'><fieldset id='XRmFA'></fieldset></dl></div>

            <tbody id='XRmFA'></tbody>
        1. <tfoot id='XRmFA'></tfoot>

              • <bdo id='XRmFA'></bdo><ul id='XRmFA'></ul>

                <small id='XRmFA'></small><noframes id='XRmFA'>

              • <legend id='XRmFA'><style id='XRmFA'><dir id='XRmFA'><q id='XRmFA'></q></dir></style></legend>

                  本文介绍了C++进程间通信的最佳方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有两个进程,一个会查询另一个数据.在有限的时间内(每秒 10000 次)会有大量查询,并且每秒将传输数据(>100 mb).数据类型将是一个整体类型(双,整数)我的问题是用什么方式连接这个过程?

                  I have two processes one will query other for data.There will be huge amount of queries in a limited time (10000 per second) and data (>100 mb) will be transferred per second.Type of data will be an integral type(double,int) My question is in which way to connect this process?

                  共享内存、消息队列、lpc(本地过程调用)或其他....

                  Shared memory , message queue , lpc(Local Procedure call) or others....

                  我还想问你推荐哪个图书馆?顺便说一下,请不要建议 MPI.在 windows xp 32 位下

                  And also i want to ask which library you suggest? by the way please do not suggest MPI. edit : under windows xp 32 bit

                  推荐答案

                  One Word: Boost.InterProcess.如果真的需要快速,共享内存是最佳选择.由于操作系统在虚拟地址和物理地址之间进行通常的映射,并且不需要数据副本,因此您的开销几乎为零.您只需要注意并发问题.

                  One Word: Boost.InterProcess. If it really needs to be fast, shared memory is the way to go. You nearly have zero overhead as the operation system does the usual mapping between virtual and physical addresses and no copy is required for the data. You just have to lookout for concurrency issues.

                  对于像 shutdownquery 这样的实际发送命令,我会使用消息队列.在我了解 boost 之前,我以前使用 localhost 网络编程来做到这一点,并使用手动共享内存分配.该死的,如果我需要重写应用程序,我会立即选择 boost.Boost.InterProcess 使这对您来说更容易.看看吧.

                  For actually sending commands like shutdown and query, I would use message queues. I previously used localhost network programming to do that, and used manual shared memory allocation, before i knew about boost. Damn if i would need to rewrite the app, I would immediately pick boost. Boost.InterProcess makes this more easy for you. Check it out.

                  这篇关于C++进程间通信的最佳方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何直接从物理内存中读取? 下一篇:由于我无法返回局部变量,从 C 或 C++ 函数返回字

                  相关文章

                  最新文章

                    <i id='SPUtY'><tr id='SPUtY'><dt id='SPUtY'><q id='SPUtY'><span id='SPUtY'><b id='SPUtY'><form id='SPUtY'><ins id='SPUtY'></ins><ul id='SPUtY'></ul><sub id='SPUtY'></sub></form><legend id='SPUtY'></legend><bdo id='SPUtY'><pre id='SPUtY'><center id='SPUtY'></center></pre></bdo></b><th id='SPUtY'></th></span></q></dt></tr></i><div id='SPUtY'><tfoot id='SPUtY'></tfoot><dl id='SPUtY'><fieldset id='SPUtY'></fieldset></dl></div>

                    • <bdo id='SPUtY'></bdo><ul id='SPUtY'></ul>

                      <legend id='SPUtY'><style id='SPUtY'><dir id='SPUtY'><q id='SPUtY'></q></dir></style></legend>
                    1. <small id='SPUtY'></small><noframes id='SPUtY'>

                      <tfoot id='SPUtY'></tfoot>