2 ms·
I've never used IOCP, but my understanding is that they can sort of emulate readiness notification (as opposed to completion notification) by passing a 0 sized
by gpderetta 8y ago
I've never used IOCP, but my understanding is that they can sort of emulate readiness notification (as opposed to completion notification) by passing a 0 sized buffer. On the callback then you would perform the (non-blocking) read yourself.
In general I think that readiness notification is superior to completion notification for network reads. Completion notification works fine for network writes and it is superior for disk IO (where readiness is ill defined).
The biggest advantage of IOCP though is that it basically acts as a dynamically sized threadpool, as it keeps the amount of running threads to a minimum. MacOS does something similar with GCD. I still haven't found a non-hacky way to do the same in Linux (you can sort-of emulate it with either with sched_fifo realtime threads or by using sched_idle to detect idelness).