asio icon indicating copy to clipboard operation
asio copied to clipboard

Does asio support the WIN RIO (Registered I/O) API?

Open Febbe opened this issue 4 years ago • 2 comments

For me, it seems like that ASIO does not support the RIO API. But this is crucial to receive millions of UDP packages, without overwhelming the CPU, since the default WINSOCK2 API will only receive one UDP package from the kernel. No matter which size is configured.

Febbe avatar Jan 25 '21 14:01 Febbe

Agreed

murshex avatar Nov 10 '22 03:11 murshex

Is there a point in still going straight for RIO, or is the expectation that socket support will eventually be adopted within ioringapi (#1200) ? Considering that both have essentially the same API design, yet incompatible types.

Apart from that - the documentation is a little bit on the unclear side, respectively the guarantees made by the API not quite on-par with IOCP:

You can link RIO with IOCP, but you can use only a single OVERLAPPED struct for the entire queue? So you have to go via a pointer in RIORESULT instead? Not an issue, just meaning that it's actually an entirely distinct code path.

The RIO API is not thread-safe (except for multi-threaded pure commit - but not for actual submission of work to queues)?

Furthermore, threaded access to any of the regular Winsock APIs appears to become dangerous as well when RIO is being used:

Synchronization is also required if multiple threads issue sends and receives on the same socket because the send and receive operations use the socket’s request queue. -- RIODequeueCompletion

There are only any significant performance gains (the mentioned multi-million PPS) when using a threading concept where one (single) thread is submitting deferred calls and potentially de-queuing, while another thread has to take the perf hit of committing the input queue in a busy loop?

Ext3h avatar Jul 11 '23 15:07 Ext3h