Re: Re: Regular File I/O

Amit Kumar k_amitcool at rediffmail.com
Tue Sep 18 08:52:09 CEST 2012


Hello Mark,



Thanks for response.

I am sorry, i understand that libev does not do any IO and actually notifies the client programs about readiness of IO.



I will look at libeio, thanks for pointers.



Please see inline, I had few comments.



Thanks

Amit 



On Mon, 17 Sep 2012 12:45:43 +0530  wrote

>On Mon, Sep 17, 2012 at 05:33:44AM -0000, Amit Kumar  wrote:



> I am evaluating libev for regular File I/O (disk based files). Going through few emails on this mailing list and on basis of my understanding of Async I/O behaviour on Linux, I believe:







libev doesn't do any I/O at all, it only notifies of the availability. For



files, this is not very useful (but works, unlike most other event libs



using epoll), because the availability is always known to the kernel, so



asking the kernel just adds overhead.







> (a) True AIO is not supported for disk based regular files as underlying OS does not has support for it. Hence libev does not has support for it as it is essentially an event loop.







linux does support true aio, and so do posix systems implementing posix



aio. the reason it's not implemented in libev is that libev doesn't do



I/O.



[AMIT]>>> Do you mean by aio_read, aio_write and checking status through aio_return. I have read at man pages and documentation that it is scalable and POSIX threads perhaps are better solution. I also noticed that POSIX Aync I/O did not have any update since 2007 and noticed that there were issues about thread management and scaling of threads.



> (b) Posix AIO is not integrated with libev.







Right, it would make no sense.







> (c) libev does not use threads for even notifications on Linux (epoll, select are used).







What exactly do you mean with threads for event notification? Start a



thread for each event? That can be done trivially in a callback. Or do



you mean waking up threads instead of calling callbacks? Libev can be



configured to do that, too. Or do you mean gathering events from multiple



threads? That is supported as well.



[AMIT]>>> I am sorry for being very raw in asking the question. My question was if libev can be used to notify a thread when I/O is ready. I see that you have mentioned this can be done. Can you please point me to the documentation for how can a thread be notified on IO being ready.





> PS: I am very new to libev, so please forgive me if i am incorrect here.







If your goal is to do async I/O (for files and similar sources), you can



use libeio, which wraps most of the posix api for asynchronous use, and can



be integrated easily into libev.







-- 



        The choice of a    Deliantra, the free code+content MORPG



   -----==-   _GNU_       http://www.deliantra.net



   ----==-- _    generation



   ---==---(_)__ __ ____ __   Marc Lehmann



   --==---/ / _ \/ // /\ \/ /   schmorp at schmorp.de



   -=====/_/_//_/\_,_/ /_/\_\



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20120918/f36bb94b/attachment.html>


More information about the libev mailing list