How to do a cleanup after SIGKILL?

后端 未结 3 1539
日久生厌
日久生厌 2020-12-31 16:53

I\'m working on a program which uses shared memory. Multiple instances of said program will either connect to an existing one or create it anew, and give it back to OS when

3条回答
  •  感情败类
    2020-12-31 17:33

    Combined with shared memory, robust mutexes located in the shared memory segment would be a great tool. If a process dies while holding a lock on a robust mutex, the next process to attempt locking it will get EOWNERDEAD and can perform the cleanup the original owner should have performed.

提交回复
热议问题