ftok() collisions

萝らか妹 提交于 2019-12-05 02:59:01

You may want to consider using POSIX shared memory (via shm_open), which doesn't suffer from this sort of key collision

Your application should always be able to deal with key collisions. A key could be in use by another unrelated process. But you could try to create your own version of ftok(), using more relevant bits.

In theory any application needs only one "master" key, pointing to a "scoreboard" where the other keys can be found. Publicizing the masterkey on the filesystem might be a good idea. Restart after a crash will always be a problem.

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