Ana Sayfa | Yaz?lar? takip   et | Yorumlar?   et

Archive

poll system call

4 Ocak 2011 Salı

The select() and poll() methods can be a powerful tool when you’re multiplexing network sockets. Specifically, these methods will indicate when a procedure will be safe to execute on an open file descriptor without any delays. For instance, a programmer can use these calls to know when there is data to be read on a socket. By delegating responsibility to select() and poll(), you don’t have to constantly check whether there is data to be read. Instead, select() and poll() can be placed in the background by the operating system and woken up when the event is satisfied or a specified timeout has elapsed. This process can significantly increase execution efficiency of a program. (If you are more concerned with performance than portability, we discuss some alternatives to select() and poll()toward the end of the article.)

As you will see, select() and poll() are very similar in functionality. Often, implementations of select() and poll() are mapped onto each other. For instance, in theApache Portable Runtime, a core component of Apache 2.0, a portable interface is provided that mimics the poll() semantics. On platforms that do not have a native poll()implementation, the poll() semantics are mapped onto select(). On FreeBSD, the libc_r implementation of select() is merely a thin wrapper around the poll() system call.


Labels:

0 yorum:

Yorum Gönder

Blogger Theme By:GosuBlogger and Araba Modelleri .