在 C/++ 上的只读共享内存中输入图的图算法 (lib)

发布于 2024-08-24 07:18:26 字数 556 浏览 9 评论 0原文

我希望有一个管理器进程通过共享内存共享图形,对于其他进程只读,这些进程将在这些图形上运行各种图形算法。我想问在研究这个问题时出现的一些问题:

  • 是否有任何图形库能够在只读 shm 中(可能是它们自己的)图形结构上进行操作?也就是说,算法需要在本地进程内存中拥有其工作空间和结果缓冲区,并且不使用图形结构中声明的任何缓冲区。

  • 我知道两个著名的库是igraphBoost。我对前者的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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

执妄 2024-08-31 07:18:26

在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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文