Preventing multiple process instances on Linux

前端 未结 5 1176
感动是毒
感动是毒 2020-12-10 17:39

What is the best way on Linux platform for the process (C++ application) to check its instance is not already running?

5条回答
  •  时光说笑
    2020-12-10 18:35

    You could use a POSIX named semaphore to do this. It is much safer than using a file lock.

提交回复
热议问题