lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Thu, Oct 18, 2012 at 6:59 AM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> in short, is there _any_ way to really check readyness of regular files?

No. Readiness doesn't mean anything. Hard drives aren't active
entities, pushing data into the kernel, so that the kernel can tell
you that data is available. You need some kind of syscall sequence
where you can tell the kernel you want data to read.

Asynchronous I/O may be what you are looking for. It is reported to
work very well on Windows, and mediumly badly on Linux (POSIX speced
some APIs, but linux doesn't support them in-kernel, last I heard,
though various proposals keep getting circulated, search through
lwn.net for more info).

Just offloading file i/o to a thread might give better asynchony (how
the posix asynch i/o calls are implemented by glibc, at least at one
time).

Cheers,
Sam