Yeah, I thought so too. But it turns out to be a bit more complex: " They are asynchronous in that there is no guarantee the pages will be in the page cache by the time they return. But at the same time, they are not guaranteed to be non-blocking. That is, the work of doing the readahead does not take place in a kernel thread. So if you try to request I/O than will fit in the request queue, the system call will block until some I/O is completed so that more I/O requested cam be loaded onto the request queue. " See this thread:
http://us.generation-nt.com/posix-fadvise-posix-fadv-willneed-waits-before-returning-help-201314802.html So, it seems there are good reasons to make them somewhat synchronous. To be fully asynch, there would need to be a way of cancelling the advice. On Sun, Jun 5, 2011 at 11:25 AM, Zsbán Ambrus <amb...@math.bme.hu> wrote: > On Sun, Jun 5, 2011 at 3:40 PM, Aaron Boxer <boxe...@gmail.com> wrote: >> Hello! >> >> Is it possible to use libev to have non-blocking access >> to a blocking system call? In my server, I want to call posix_fadvise() >> on a file, and want to receive a callback when the call returns. > > I thought the posix_fadvise system call would't block for any call anyway. > > Ambrus > _______________________________________________ libev mailing list libev@lists.schmorp.de http://lists.schmorp.de/cgi-bin/mailman/listinfo/libev