Skip to contentSkip to conversation

sendfile/splice - Non-blocking input?

DISCUSSION Aiko Barz 1 participant 1 message May 30, 2011

lore
Share & tools
lore

Aiko Barz

author
#0 lore raw

Hello,

is sendfile/splice completely non-blocking on the input side?

I am writing a small webserver for educational reasons. I use epoll to deal with the network part. From what I have read, I have to avoid blocking code under all circumstances. And the linux implementation of sendfile seems to block until the file enters the pagecache.

Most of the docs are not completely up to date. I figured out, that sendfile is now a frontend for splice. So, does it still block?

Or differently asked: May I call sendfile directly from the few epoll threads or do I have to execute sendfile/splice within independent worker threads?

Kind regards,
Aiko Barz

Signature · 1 line
:wq ✉