cURL / Mailing Lists / curl-library / Single Mail


Re: libcurl and async I/O

From: Jamie Lokier <>
Date: Sun, 17 Aug 2008 23:58:55 +0100

Cory Nelson wrote:
> Well, the current way of doing it (select) supports that model too --
> it's just not anything close to IOCP's efficiency which scales to tens
> of thousands of concurrent operations.

On Windows, IOCP means asynchronous I/O (in the kernel, not using
threads), _plus_ some magic to control the number of
completion-handling threads to match concurrency level with the number
of CPUs.

Ignoring the latter part (also called "scheduler activations" in some
unixes), the equivalent on Linux and POSIX generally is AIO: aio_read,
aio_write etc.

If I recall correctly, some experiemnts with AIO for networking on
Linux were promising, but performance from epoll + read/write gave
better results.

In other words, you can handle tends of thousands of concurrent
operations in Linux using the curl-hiper mode as it is, with epoll as
the event loop mechanism.

Similar presumably applies on other unix-like OSes with something
like epoll (that's most of them now).

Even Windows has socket event mechanisms like epoll (WSAAsyncSelect),
but it's clearly oriented more around an IOCP model.

-- Jamie
Received on 2008-08-18