【发布时间】:2012-03-20 12:17:40
【问题描述】:
我很难通过信号和共享内存来管理子进程(我知道管道可能会更好)。我有以下循环:
* parent processing something, then signaling the children and going into pause,
* children processing something, then signaling the parent and going into pause,
* etc. etc.
问题在于,在向父级发出信号(通过 kill)之后的某个时间,操作系统切换到父级,而从未让子级暂停()。当它恢复孩子时(在父母调用暂停之后),孩子然后暂停,我有一个死锁:(。
有什么建议吗?
【问题讨论】:
标签: c++ linux process deadlock shared-memory