Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
4.2k views
in Technique[技术] by (71.8m points)

为什么边缘触发必须使用非阻塞的文件描述符?

一种解释是如果使用阻塞,调用epoll-wait之后,read可能一致阻塞,但是如果水平触发使用阻塞io也可能read一致阻塞啊。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

为什么 IO 多路复用要搭配非阻塞 IO? - 知乎 (zhihu.com)

可以参考这个提问下的回答,实际上不管是边沿触发还是水平触发,都要使用非阻塞io避免可能的阻塞。


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...