Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

同步信号以规避竞争条件 #18

Open
WyattJia opened this issue May 16, 2017 · 0 comments
Open

同步信号以规避竞争条件 #18

WyattJia opened this issue May 16, 2017 · 0 comments

Comments

@WyattJia
Copy link
Owner

WyattJia commented May 16, 2017

调用 fork() 之后,如果进程甲需要等待进程乙完成某一动作,那么乙(即活动进程)可在动作完成后向甲发送信号;甲则等待即可。
如果是子进程反过来要等待父进程,那么父、子进程中与信号相关的调用对调即可。父、子进程甚至可能多次互发信号以协调彼此行为,尽管实际上更有可能采用信号量、文件锁或者消息传递等技术来进行此类协调。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant