![](/img/trans.png)
[英]Message queue using shared memory/semaphore, how to check if if there is no process connected to the queue?
[英]how to determine which process is using a queue?
我有一個消息隊列ID,我需要確定哪些進程正在讀取和寫入該隊列。 是否有可能與'ipcs'一起使用的選項?
ipcs -q|grep qid
這不提供這些細節。 謝謝
您只能檢索調用msgsnd()
的最后一個PID以及為指定的System V消息隊列調用msgrcv()
的最后一個PID。
您可以使用:
ipcs -q -p
它將輸出:
------ Message Queues PIDs --------
msqid owner lspid lrpid
哪里:
lspid
- 最后一個msgsnd()
PID lrpid
- 最后一個msgrcv()
PID
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.