Received: by 10.220.172.9 with SMTP id j9mr4484424vcz.4.1294625518396; Sun, 09 Jan 2011 18:11:58 -0800 (PST) X-BeenThere: nodejs-dev@googlegroups.com Received: by 10.220.109.143 with SMTP id j15ls994451vcp.1.p; Sun, 09 Jan 2011 18:11:56 -0800 (PST) MIME-Version: 1.0 Received: by 10.220.180.205 with SMTP id bv13mr1162376vcb.4.1294625516377; Sun, 09 Jan 2011 18:11:56 -0800 (PST) Received: by e20g2000vbn.googlegroups.com with HTTP; Sun, 9 Jan 2011 18:11:56 -0800 (PST) Date: Sun, 9 Jan 2011 18:11:56 -0800 (PST) In-Reply-To: X-IP: 86.46.40.152 References: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10,gzip(gfe) Message-ID: <5d7e752e-c2f8-4888-b09e-e77d778d17fb@e20g2000vbn.googlegroups.com> Subject: Re: Asynchronous file I/O with AIO From: billywhizz To: nodejs-dev Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable i agree that the libeio solution seems hacky but don't know enough about the alternatives (namely Posix AIO) to offer an educated opinion. i was recently reading this though: http://davmac.org/davpage/linux/async-io.html and am wondering if this criticism of AIO on Linux is still valid: "aio_suspend(), while it might seem to solve the issue of notification, requires scanning the list of the aiocb structures by the kernel (to determine whether any of them have completed) and the userspace process (to find which one completed). That is to say, it has exactly the same problems as poll()" i can sympathise with the desire to have a generic/cross-platform io library like libeio as the default in node but would be very interested in a compatible alternative library based on something that performs better for specific platforms, i.e. AIO on linux/osx, Overlapped IO/Completion ports on Windows... On Jan 9, 10:18=A0pm, Rasmus Andersson wrote: > On Sun, Jan 9, 2011 at 19:00, Marco Rogers wrote= : > > I'm always interested when this thread comes back up. There has been > > discussion on it before. I keep these bookmarked for reference. =A0Some > > key points. The author of libeio doesn't think AIO is always better. > > Also Ry would much prefer any AIO support to be implemented as part of > > libeio. =A0Of course these sentiments may have changed. > > >http://groups.google.com/group/nodejs/browse_thread/thread/aff97d25c5... > >http://groups.google.com/group/nodejs/browse_thread/thread/de115072e2... > > Thanks for the update! > > In my opinion: > > - libeio -- a "hack" to make blocking system calls non-blocking > - libev -- event-based runloop framework for working with asynchronous > I/O, timers and signals > > Putting AIO support in libeio feels a little bit like flying an > airplane inside another airplane. Libev on the other hand, has the > official shortcoming of not supporting file descriptors pointing to > files. Simply adding AIO support to the internals of libev and -- > voil=E1 -- you can pass a filesystem file descriptor and use all the > existing infrastructure. Such a solution would mean less code for node > and numerous other projects using libev. > > > > > > > > > > > > > Hope this background is helpful. =A0I always learn a lot from these > > discussions. > > > :Marco > > > On Jan 9, 1:39=A0am, Rasmus Andersson wrote: > >> On Sun, Jan 9, 2011 at 06:31, Liam wrote: > >> > I think the question is: should we consider implementing a new fs i/= o > >> > lib that leverages the native OS better, assuming there's sufficient > >> > AIO support in the mostly widely used OSes... > > >> Yeah, that's the question. Personally, I'm using node.js instead of > >> Python, Perl or Ruby nowadays and see it as a replacement for all > >> tasks those environments otherwise serve. Kind of like my > >> universal/default programming environment. Disk I/O is a pretty > >> important feature in these use-cases (crunching logs, etc), so I think > >> AIO support would be a nice idea. It's not that much work given it's > >> possible to use aio_suspend with the relatively simplistic libev > >> runloop (I think we would need to query libev for any timers and set a > >> slightly pessimistic timeout based on that on aio_suspend though). > > >> Putting AIO support into libeio doesn't make sense (adding AIO support > >> to libev make a little more sense though). > > >> > On Jan 8, 8:21=A0pm, Isaac Schlueter wrote: > >> >> It seems to me like this is something that should live in the EIO > >> >> implementation, rather than in node. > > >> -- > >> Rasmus Andersson > > --