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

fix error link. #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions docs/java/java-concurrent.md
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,10 @@ Future接口主要包括5个方法:
4. isDone()方法判断当前方法是否完成
5. isCancel()方法判断当前方法是否取消

> 参考链接:https://blog.csdn.net/u014209205/article/details/80598209

![](http://img.topjavaer.cn/img/20220612101342.png)

## select、poll、epoll之间的区别

select,poll,epoll都是IO多路复用的机制。I/O多路复用就通过一种机制,可以监视多个描述符,一旦某个描述符就绪(一般是读就绪或者写就绪),能够通知程序进行相应的读写操作。但select,poll,epoll本质上都是同步I/O,因为他们都需要在读写事件就绪后自己负责进行读写,也就是说这个读写过程是阻塞的,而异步I/O则无需自己负责进行读写,异步I/O的实现会负责把数据从内核拷贝到用户空间。
Expand All @@ -1235,7 +1239,3 @@ select的时间复杂度O(n)。它仅仅知道有I/O事件发生了,却并不
poll的时间复杂度O(n)。poll本质上和select没有区别,它将用户传入的数组拷贝到内核空间,然后查询每个fd对应的设备状态, 但是它没有最大连接数的限制,原因是它是基于链表来存储的.

epoll的时间复杂度O(1)。epoll可以理解为event poll,不同于忙轮询和无差别轮询,epoll会把哪个流发生了怎样的I/O事件通知我们。所以我们说epoll实际上是事件驱动的。

> 参考链接:https://blog.csdn.net/u014209205/article/details/80598209

![](http://img.topjavaer.cn/img/20220612101342.png)