admin管理员组文章数量:1125335
I recently figured out that there are differences between non-blocking communication and asynchronous communication. I thought that they are same things.
And then I was introduced to the concept of event loop.
but I have some confusions and questions about this topic. I visited all related topics and questions but I could not find my answers. these are my questions:
1- Is the event loop inherently used to implement asynchronous communication or non-blocking communication? if we have an event loop like this (with single thread), then we have a non-blocking communication or asynchronous communication? I know that in a non-blocking+asynchronous communication, event loop helps but I want know that event loop by nature implements what type of communication.
2- If the answer to the above question is that the communication is non-blocking, then whenever someone says that an event loop is used in an asynchronous communication, can we immediately conclude that that communication is also non-blocking?
3- We see that the event loop has only one thread. It can be concluded that "single-threaded asynchronous communication" must use the event loop, and since it uses the event loop, then this asynchronous communication must also be non-blocking?
In general, the idea that has formed in my mind is that a non-blocking communication has only one thread and is implemented with an event loop, and an asynchronous communication is implemented with multiple threads.
And if someone says that our asynchronous communication has only one thread, I assume that then it must also be a non-blocking communication and an event loop is used in it. And if someone says that our non-blocking communication has implemented by multiple threads, then I assume that it must also be a asynchronous communication (and we have some promises like Future and CompletableFuture or something like that maybe.)
I am completely confused. help me please.
本文标签:
版权声明:本文标题:operating system - Is the event loop inherently used to implement asynchronous communication or non-blocking communication? - St 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736654382a1946215.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论