poll使用数组的捏,不是链表。红黑树也不可能O(1)啊,是O(logn)的。 man poll可以得到以下描述: int poll(struct pollfd *fds, nfds_t nfds, int timeout); The set of file descriptors to be monitored is specified in the fds argument, which is an array of structures of the following form: struct pollfd { int fd; /* file descriptor */ short events; /* requested events */ short revents; /* returned events */ }; The caller should specify the number of items in the fds array in nfds.
1

相关推荐

牛客网
牛客网在线编程
牛客网题解
牛客企业服务