Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any advantage with RIO of IOCP over events?

Tags:

sockets

winapi

RIO here stands for the Windows8 'Registered I/O' Networking extensions. From looking at example code, it seems that regardless of whether you are using RIONotify with events or IO Completion Ports, you basically end up writing the same loop, and would have nearly identical performance characteristics. The loop body is:

RIONotify() [event or IOCP]
Wait [on the event, or using GetQueuedCompletionStatus()]
RIODequeueCompletion()
// Process the dequeued events

Basically it seems like the usage of IO Completion Port is providing no additional functionality over 'event' notify/waiting, since the actual queue of messages is done with RIODequeueCompletion. So it doesn't matter whether you use events, or IOCP. My question is, am I overlooking any interesting or important difference between the models?

like image 527
Tim Lovell-Smith Avatar asked Feb 08 '23 21:02

Tim Lovell-Smith


1 Answers

RIO is about registering buffers with the kernel to save overhead and about more efficient queue management. It's not a fundamental shift. Just a lot less overhead.

IOCP is not about increasing the performance of individual actions. It is about using less threads and about context switching less. RIO takes it a little further.

like image 141
usr Avatar answered Feb 13 '23 12:02

usr