如何在托管共享内存段中创建同步机制?
我试图让 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为最好的解决方案是容器处理程序,以及通过处理程序对容器的所有访问(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.