Understanding the posix interprocess semaphore

后端 未结 2 1097
醉梦人生
醉梦人生 2021-01-20 06:28

According to my understanding, a semaphore should be usable across related processes without it being placed in shared memory. If so, why does the following code deadlock?

2条回答
  •  悲哀的现实
    2021-01-20 07:01

    An excellent article on this topic, for future passers-by:

    http://blog.superpat.com/2010/07/14/semaphores-on-linux-sem_init-vs-sem_open/

提交回复
热议问题