From: Goswin von Brederlow <goswin-v-b@web.de>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Goswin von Brederlow <goswin-v-b@web.de>,
Miklos Szeredi <miklos@szeredi.hu>,
linux-kernel@vger.kernel.org
Subject: Re: include/linux/aio_abi.h and IOCB_CMD_POLL
Date: Fri, 05 Jun 2009 00:53:43 +0200 [thread overview]
Message-ID: <87zlcnwqyw.fsf@frosties.localdomain> (raw)
In-Reply-To: <alpine.DEB.1.10.0906040814360.21635@makko.or.mcafeemobile.com> (Davide Libenzi's message of "Thu, 4 Jun 2009 08:19:36 -0700 (PDT)")
Davide Libenzi <davidel@xmailserver.org> writes:
> On Thu, 4 Jun 2009, Goswin von Brederlow wrote:
>
>> Miklos Szeredi <miklos@szeredi.hu> writes:
>>
>> > On Thu, 04 Jun 2009, Goswin von Brederlow wrote:
>> >> 3) Are there any alternatives to libaio that don't use threads and
>> >> support polling?
>> >
>> > There are the poll, select and epoll interfaces that block, but are
>> > able to multiplex events from many file descriptors.
>>
>> Unfortunately libaio does not use an fd to pass events between user
>> and kernel space so one can't use poll, select or epoll to wait for
>> /dev/fuse or libaio to have some work pending. And none of them
>> replace libaio functionality in respect to read/write.
>
> You can use the eventfd bridge between epoll/poll/select and AIO, that is
> available by quite some time.
> This is an old example I made when the patch was posted:
>
> http://www.xmailserver.org/eventfd-aio-test.c
>
> This uses direct syscall interface, but you get the idea on how to do that
> with libaio (that I never used).
Thanks. That example explains it nicely. There really should be
comments in libaio.h and an /usr/share/doc/libaio/examples/.
In case you wonder the libaio just wraps the system calls and provides
helpers in libaio.h. Basically the first 200 lines of the example are
libaio.h. Not 1:1 but nearly. The only difference is that io_prep_* do
not take an eventfd argument but there is
static inline void io_set_eventfd(struct iocb *iocb, int eventfd)
instead.
Now I have 2 ways of doing this. Always with the choices. :)
MfG
Goswin
prev parent reply other threads:[~2009-06-04 22:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-03 23:18 Goswin von Brederlow
2009-06-04 13:16 ` Miklos Szeredi
2009-06-04 15:18 ` Goswin von Brederlow
2009-06-04 15:19 ` Davide Libenzi
2009-06-04 22:53 ` Goswin von Brederlow [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87zlcnwqyw.fsf@frosties.localdomain \
--to=goswin-v-b@web.de \
--cc=davidel@xmailserver.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®