Advantages and Disadvantages to Select

 < 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 > 



BSD Sockets Programming from a Multi-Language Perspective
Network Programming for Microsoft Windows , Second Edition (Microsoft Programming Series)
ISBN: 1584502681
EAN: 2147483647
Year: 2003
Pages: 225
Authors: Jim Ohlund

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net