How do I create synchronization mechanisms in managed shared memory segments?

元气小坏坏 提交于 2019-12-11 04:49:14

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/1321530/how-do-i-create-synchronization-mechanisms-in-managed-shared-memory-segments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!