Once the monitoring application attempts another select or blocking read , those calls will return immediately since there is unread event occurrence data waiting in the buffer.
当监视应用程序试图执行另一次select或阻塞的read调用时,这些调用会立即返回,因为缓冲区中有未读的事件发生数据。
The ideal number is one per processor, but that implies that none of these threads should execute a blocking operation such as a synchronous read/write or a wait on an event.
理想的情况是,线程数量等于处理器的数量,不过这也要求任何线程都不应该执行诸如同步读写、等待事件通知等阻塞型的操作,以免线程阻塞。
The asynchronous I/O allows applications to read and write data without blocking.
异步I/O让应用程序能够在不阻塞的情况下读写数据。
In blocking mode, a thread will block on a read or a write until the operation is completely finished.
在阻塞模式中,线程将在读或写时阻塞,一直到读或写操作彻底完成。
Wait on event occurrences with the select() (or a blocking read()) system call.
使用select()(或阻塞的read())系统调用等待事件发生。
Programs should not count on this method to return the actual number of bytes that could be read without blocking.
程序不能依靠此方法返回不阻塞条件下读取的实际字节数。
There are several conditions which cause select() or a blocking read() to return.
几种情况会导致select()或阻塞的read()返回。
A blocking syscall, like a read will only return once data is available.
阻塞的系统调用,就拿读取来说,直到数据准备好的时候才会返回。
When dealing with multiple file descriptors, an application typically sets each file descriptor as non-blocking (as shown in Listing 1) and issues a read on one file descriptor at a time.
在处理多个文件描述符时,应用程序通常把每个文件描述符设置为非阻塞(见清单1),每次对一个文件描述符执行read调用。
When dealing with multiple file descriptors, an application typically sets each file descriptor as non-blocking (as shown in Listing 1) and issues a read on one file descriptor at a time.
在处理多个文件描述符时,应用程序通常把每个文件描述符设置为非阻塞(见清单1),每次对一个文件描述符执行read调用。
应用推荐