select
— 等待 I/O 完成
¶
此模块提供访问
select()
and
poll()
函数可用于大多数操作系统,
devpoll()
可用于 Solaris 及衍生,
epoll()
可用于 Linux 2.5+ 和
kqueue()
available on most BSD. Note that on Windows, it only works for sockets; on other operating systems, it also works for other file types (in particular, on Unix, it works on pipes). It cannot be used on regular files to determine whether a file has grown since it was last read.
注意
The
selectors
module allows high-level and efficient I/O multiplexing, built upon the
select
module primitives. Users are encouraged to use the
selectors
module instead, unless they want precise control over the OS-level primitives used.
可用性 :非 WASI。
This module does not work or is not available on WebAssembly. See WebAssembly 平台 了解更多信息。
模块定义如下:
- select. devpoll ( ) ¶
-
(Only supported on Solaris and derivatives.) Returns a
/dev/pollpolling object; see section /dev/poll Polling Objects below for the methods supported by devpoll objects.devpoll()objects are linked to the number of file descriptors allowed at the time of instantiation. If your program reduces this value,devpoll()will fail. If your program increases this value,devpoll()may return an incomplete list of active file descriptors.新文件描述符 不可继承 .
Added in version 3.3.
3.4 版改变: 现在,新文件描述符不可继承。