Well there are two kinds - the POSIX API provided by glibc that just uses threads in userspace to offload IO (so its basically no different to running your own thread-pool), and the kernel provided io_* async routines that bypass the page cache so are of limited use.
FreeBSD provides better async block IO...with read completion events popping of the end of your kqueue alongside all your other events (socket, timers, signals etc).
I partially came across this article after researching the claims made in this nginx blog post https://www.nginx.com/blog/thread-pools-boost-performance-9x.... I thought it was cool that someone was delving deep into to the heart of the matter 15 years earlier.
5 comments
[ 3.4 ms ] story [ 21.1 ms ] threadI wonder how it compares to linux async io?
Well there are two kinds - the POSIX API provided by glibc that just uses threads in userspace to offload IO (so its basically no different to running your own thread-pool), and the kernel provided io_* async routines that bypass the page cache so are of limited use.
FreeBSD provides better async block IO...with read completion events popping of the end of your kqueue alongside all your other events (socket, timers, signals etc).
I partially came across this article after researching the claims made in this nginx blog post https://www.nginx.com/blog/thread-pools-boost-performance-9x.... I thought it was cool that someone was delving deep into to the heart of the matter 15 years earlier.