在 C/++ 上的只读共享内存中输入图的图算法 (lib)
我希望有一个管理器进程通过共享内存共享图形,对于其他进程只读,这些进程将在这些图形上运行各种图形算法。我想问在研究这个问题时出现的一些问题:
是否有任何图形库能够在只读 shm 中(可能是它们自己的)图形结构上进行操作?也就是说,算法需要在本地进程内存中拥有其工作空间和结果缓冲区,并且不使用图形结构中声明的任何缓冲区。
我知道两个著名的库是igraph和Boost。我对前者的C接口不太了解,也没有使用过Boost。在该主题(关于 shm 兼容性)方面有什么经验吗?
在查看 Boost 文档时,我看到有一个支持 shm 的 Boost.Interprocess 包。
- 起初我考虑使用手动制作的 shm 和 mmapped shm(Linux 平台)。 Boost 是否优于此方法并值得推荐?
- Boost Graph 库与手动 shm 或 Interprocess 配合得很好吗?
除了对这些问题的见解之外,我很高兴阅读您有关图形处理和共享内存的经验。谢谢!
I would like to have a manager process sharing graphs via shared memory, read-only for other processes which will run various graph algorithms on these graphs. I would like to ask some questions emerged while researching the issue:
Are there any graph libraries which are able to operate on (possibly their own) graph structures in read-only shm? That is, the algorithms would need to have their workspace and result buffers in the local process memory, and not use any buffers declared in the graph structure.
Two libs which I know are famous are igraph and Boost. I don't know much about the C interface of the former and haven't used Boost yet. Any experience in the topic (regarding shm compatibility)?
When looking in the Boost docs, I see that there is a Boost.Interprocess package with shm support.
- At first I thought about using manually crafted shm with mmapped shm (Linux platform). Is Boost superior and recommended over this method?
- Does the Boost Graph library plays nice along with manual shm or Interprocess?
Apart from insights about these questions I would be glad to read about your experience regarding graph processing and shared memory. Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在Boost Graph Library中,各种图形类型只是概念( http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/graph_concepts.html)。
您应该能够实现自己的图形结构,遵循您需要的概念,并对您自己的数据应用任何 BGL 算法(或者可能只是将您的共享数据包装在 edge_list 类中 http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/edge_list。 html )。
由于您正在研究共享内存,您可能也对并行 BGL 感兴趣( http://www.boost.org/doc/libs/1_42_0/libs/graph_parallel/doc/html/index.html)
HTH
In Boost Graph Library the various graph types are just concepts ( http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/graph_concepts.html ).
You should be able to implement your own graph structure, adhere to the concept you need and apply any BGL algorithm on your own data (or perhaps just wrap your shared data in an edge_list class http://www.boost.org/doc/libs/1_42_0/libs/graph/doc/edge_list.html ).
Since you are looking at shared memory you might also be interested in the Parallel BGL ( http://www.boost.org/doc/libs/1_42_0/libs/graph_parallel/doc/html/index.html )
HTH