| < Day Day Up > |
|
The select call in most operating systems is notoriously slow. In most implementations (except for Windows), the select call can be used to multiplex I/O not only for socket descriptors, but also for any other type of file descriptor (such as files, serial ports, and so on).
The select call is most commonly used to identify the ability to read, write, or identify whether an exception occurs on a set of descriptors. Upon one or more of these events occurring on a set of descriptors, the select call returns with this set information to the application so that it can then enumerate through the set and take appropriate action. The advantage to the select call is that a single thread can manage a large set of sockets compactly.
Rather than use the select call, another approach is to utilize a thread of control for each descriptor. This comes with the cost of context switches for each of the threads, but reduces the latency of I/O operations dramatically.
| < Day Day Up > |
|