On 28 Nov 2005, at 19:27, christopher baus wrote:
Thank you, Its very interesting , because I'm using 2.6.5
kernel which
does supports epoll , but every time I tried call a epoll_ctl with an
ADD operation on the regular file , I get back a NOPERM errro
back, so I
was wondering if anybody succeeded before ( google not in much
help :()
Linux doesn't support non-blocking I/O on files. If you don't require
high throughput to disk your best bet is to use worker threads.
This is
basically how squid handle's its disk cache.
If you are doing light disk writes your application might be able
to get
away with blocking files because writes to the disk cache are
basically
non-blocking.
You can use inotify to give you an event when a file changes.
http://kerneltrap.org/node/3847
There is even a perl module in cpan for working with it. Surely this
is not too far off what you want?
I can make no comparison in terms of system overheads between using
workers and inotify though.
And er, you can do non-blocking I/O on files. You will get EOF when
you reach the end of the file, and once more data comes in you will
receive it. Obviously this means spinning around on read() calls
though which isn't really that nice a thing to do.
_______________________________________________
Libevent-users mailing list
[email protected]
http://monkey.org/mailman/listinfo/libevent-users