如何在托管共享内存段中创建同步机制?

发布于 2024-08-02 15:31:53 字数 117 浏览 13 评论 0原文

我试图让 2 个进程通过 stl 容器进行通信 - 所以我决定使用托管共享内存。我正在尝试在它们之间实现一些同步 - 以scoped_lock 开始的interprocess_mutex - 但我运气不佳。应该怎么做呢?

I'm trying to have 2 processes communicate via an stl container - so I've decided to use the managed shared memory. I'm trying to implement some synchronisation between them - an interprocess_mutex for a start with a scoped_lock - but I'm not having much luck. How is it supposed to be done?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

一抹苦笑 2024-08-09 15:31:53

我认为最好的解决方案是容器处理程序,以及通过处理程序对容器的所有访问(getter/setter)。所以在这个处理程序中你可以轻松地实现同步。

萨鲁2.

I think the best solution is a container handler, and all access (getter/setter) to the container through the handler. So in this handler you could implement the synchronisation easily.

Salu2.

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