简体   繁体   English

可以增加不同CPU上的进程之间的共享内存

[英]Can boost do shared memory between processes that are on different CPUs

If i have a multiprocessor with 2 CPUs, and i have a process running on CPU 1, and another process on CPU 2, is boost::interprocess shared memory be used between them? 如果我有一个带有2个CPU的多处理器,并且我有一个进程在CPU 1上运行,而另一个进程在CPU 2上,是否在它们之间使用boost :: interprocess共享内存? If so, how is that implemented? 如果是这样,如何实施? I couldn't find any documentation in the boost docs about it 我在关于它的增强文档中找不到任何文档

It is not advantage of boost, but platform. 这不是Boost的优势,而是平台。 Boost uses shmem or memory mapped files support in the level of operating system. Boost在操作系统级别使用shmem内存映射文件支持。

Yes, if you're on either an SMP or standard NUMA system. 是的,如果您使用的是SMP或标准NUMA系统。

Maybe not if some of your CPUs are running on daughter boards or similar. 如果您的某些CPU在子板上或类似板上运行,则可能不会。


The OS and underlying hardware platform (which you haven't told us) control this, and you should be able to ask a question specific to that OS/platform in an appropriate forum if you're still not sure. 操作系统和底层硬件平台(您尚未告诉我们)可以控制此操作,如果您不确定,您应该可以在适当的论坛中提出特定于该操作系统/平台的问题。

If you're not sure which of the above two cases are relevant, it's almost certain you're on a general-purpose platform and it will all work. 如果您不确定上述两种情况中的哪一种是相关的,那么几乎可以肯定您使用的是通用平台,并且一切正常。 Note that Boost may not expose NUMA affinity control however, if you want to choose which node pages are allocated on. 请注意,如果要选择分配哪些节点页面,Boost可能不会公开NUMA关联性控件。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 boost::interprocess 32 和 64 位进程之间的共享内存 - boost::interprocess shared memory between 32 and 64 bit processes 进程之间不共享共享内存 - shared memory is not shared between processes 在资源有限的不同进程之间建立共享内存? - Establishing shared memory between different processes with limited resources? 在两个进程(C和C ++)之间提升Boost的managed_shared_memory用法 - Boost's managed_shared_memory usage in between two processes (C and C++) 如果其他进程可以对其进行迭代,如何安全地清除共享内存中的boost :: interprocess:vector? - How can I safely clear a boost::interprocess:vector in shared memory if other processes could be iterating over it? C ++和Java进程之间的共享内存 - Shared memory between C++ and Java processes Ubuntu在两个进程之间共享内存,代码不起作用 - Ubuntu Shared Memory Between 2 Processes, Code Not Working 如何使用运行时大小参数构造 boost spsc_queue 以使用共享内存在两个进程之间交换 cv::Mat 对象? - How to construct boost spsc_queue with runtime size parameter to exchange cv::Mat objects between two processes using shared memory? 如何保护两个进程之间共享 memory 中的字符串? - How do I protect a character string in shared memory between two processes? 如何在共享内存的同一区域上工作的两个进程之间共享锁? - How do I share locks between two processes working on the same region of shared memory?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM