开发者

Does a process know whether a system resource is used by other process? How can I cleanup the system resource safely?

开发者 https://www.devze.com 2023-03-20 08:29 出处:网络
The question comes from: RAII and system resource cleanup Actually c开发者_StackOverflow中文版leanup system resource is hard. In my mind, a process can\'t \"know\" whether a system resource(file, mes

The question comes from: RAII and system resource cleanup

Actually c开发者_StackOverflow中文版leanup system resource is hard. In my mind, a process can't "know" whether a system resource(file, message queue, semaphore, shared memory) is used by other process or not. If it's true, how to guarantee to cleanup system resource safely?

If that is no a reliable way to do that, how can we do? Are there some common ways for it?

0

精彩评论

暂无评论...
验证码 换一张
取 消