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?
精彩评论