进程间通信
我有4个进程,说p1.p2,p3,p4 ..进程p1必须向p2发送一个信号,表明它已获得init,并且该信号必须被p2捕获,然后它必须获得init ...并且p3和p4进程有要在初始化后从 p2 获取信号,那么这些进程必须进行初始化......
你可以建议执行此操作的逻辑或者如果可能的话示例代码
提前致谢
i have 4 processes say p1.p2,p3,p4..process p1 has to send a signal to p2 that it got init and that signal has to catch by p2 then it has to get init ...and p3 and p4 process has to get signal from p2 after its init then these process has to get init.........
can u suggest the logic in doing this or if possible sample code
thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
比如说,你有 1、2、3、4。那么:
对吧?
我会直接发送信号。你的问题出在哪里?
在 C 中,您必须包含 signal.h 并必须为所需信号(例如 SIGUSR1)指定处理程序子例程。
Say, you have 1,2,3,4. Then:
Right?
I would just directly send signals. Where is your problem?
In C you have to include signal.h and have to specify a handler subroutine for required signal (e.g. SIGUSR1).