Correct statement about select on windows
This commit is contained in:
parent
336a768a21
commit
1c15142618
@ -46,15 +46,20 @@
|
||||
is done in Unix.
|
||||
|
||||
<p>Windows presents asynchronous and non-blocking I/O differently than in Unix.
|
||||
The syscall <code>select()</code> is available in Windows but it
|
||||
supports only 64 file descriptors—which is unacceptable for
|
||||
high-concurrency servers. Instead a system called <a
|
||||
href="http://msdn.microsoft.com/en-us/library/ms686358(v=vs.85).aspx">overlapped
|
||||
I/O</a> is used. <a
|
||||
href="http://msdn.microsoft.com/en-us/library/aa365198(VS.85).aspx">I/O
|
||||
completion ports</a> (IOCPs) are the objects used to poll overlapped I/O
|
||||
for completion.
|
||||
IOCPs are similar to the Unix I/O multiplexers
|
||||
The syscall
|
||||
<a href="http://msdn.microsoft.com/en-us/library/ms740141(v=VS.85).aspx"><code>select()</code>
|
||||
is available in Windows</a>.
|
||||
<code>select</code> processing is O(n) in the number of file descriptors
|
||||
unlike the modern constant-time multiplexers like epoll which makes it
|
||||
unacceptable for high-concurrency servers.
|
||||
|
||||
<p>
|
||||
Windows has another way of polling called
|
||||
<a href="http://msdn.microsoft.com/en-us/library/aa365198(VS.85).aspx">I/O completion ports</a>
|
||||
(IOCPs). IOCPs are the objects used to poll
|
||||
<a href="http://msdn.microsoft.com/en-us/library/ms686358(v=vs.85).aspx">overlapped I/O</a>
|
||||
for completion. IOCP polling is constant time (REF?).
|
||||
They are similar to the Unix I/O multiplexers
|
||||
<ul>
|
||||
<li> <a
|
||||
href="http://en.wikipedia.org/wiki/Kqueue">kqueue</a> on Macintosh and
|
||||
@ -536,7 +541,7 @@ IOCP:
|
||||
— an async <code>sendfile()</code> for windows.
|
||||
<li><a href="http://msdn.microsoft.com/en-us/library/ms741565(v=VS.85).aspx"><code>WSADuplicateSocket()</code></a>
|
||||
— describes how to share a socket between two processes.
|
||||
<li><a href="http://msdn.microsoft.com/en-us/library/6e3b887c.aspx"><code>_setmaxstdio()</code></a>
|
||||
<li id="setmaxstdio"><a href="http://msdn.microsoft.com/en-us/library/6e3b887c.aspx"><code>_setmaxstdio()</code></a>
|
||||
— something like setting the maximum number of file decriptors
|
||||
and <a
|
||||
href="http://www.kernel.org/doc/man-pages/online/pages/man2/setrlimit.2.html"><code>setrlimit(3)</code></a>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user