来自shm_unlink的手册页 memory objectAfter a successful shm_unlink(), attempts to shm_open()
an object with the same name fail (unless O_CREATunmapped the object, de-allocates and destroys the conte
我对Linux API sem_unlink()有点困惑,主要是在什么时候或为什么调用它。我在Windows中使用信号量已经很多年了。但是在Linux中,开发人员需要通过调用sem_unlink()来删除内核对象。如果不这样做,内核对象将保留在/dev/shm文件夹中。我遇到的问题是,如果进程A调用sem_unlink(),而进程B锁定了信号量,它会立即销毁信号量,现在当进程C出现时,进程B不再受信号量的“保护”。显然,我不了解Linux上信号量对象的正确用法。谢谢你