qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Bligh <alex@alex.org.uk>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org, Alex Bligh <alex@alex.org.uk>
Subject: Re: [Qemu-devel] Question on aio_poll
Date: Wed, 24 Jul 2013 09:05:03 +0100	[thread overview]
Message-ID: <82CDEC496AE9AD63FCCEBD0C@nimrod.local> (raw)
In-Reply-To: <20130724075439.GC31445@stefanha-thinkpad.muc.redhat.com>

Stefan,

--On 24 July 2013 09:54:39 +0200 Stefan Hajnoczi <stefanha@gmail.com> wrote:

>> I left this how it was in the end (I think), and got round it by
>> creating a bogus pipe for the test to listen to.
>
> Doing that requires the changes in my patch series, otherwise you break
> aio_poll() loops that are waiting for pending I/O requests.  They don't
> want to wait for timers.

Sorry I meant leaving the main code as is, and creating the bogus
pipe solely in tests/test-aio.c in my new test that tests a timer
attached to AioContext - no changes elsewhere.

> I hope we can eventually unify event loops and then the select function
> should behave as you described.  For now though, we need to keep the
> current behavior until my .io_flush() removal series or something
> equivalent is merged, at least.

OK. That's pretty much the way I went with the PATCHv2 series.

>> I note you now have:
>>     if (ctx->pollfds->len == 1) {
>>         return progress;
>>     }
>>
>> Is the '1' there the event notifier? How do we know there is only
>> one of them?
>
> There many be many EventNotifier instances.  That's not what matters.
>
> Rather, it's about the aio_notify() EventNotifier.  Each AioContext has
> its own EventNotifier which can be signalled with aio_notify().  The
> purpose of this function is to kick an event loop that is blocking in
> select()/poll().  This is necessary when another thread modifies
> something that the AioContext needs to act upon, such as adding/removing
> an fd.

Thanks

-- 
Alex Bligh

      reply	other threads:[~2013-07-24  8:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-20 13:14 [Qemu-devel] Question on aio_poll Alex Bligh
2013-07-23 12:18 ` Stefan Hajnoczi
2013-07-23 14:46   ` Alex Bligh
2013-07-24  7:54     ` Stefan Hajnoczi
2013-07-24  8:05       ` Alex Bligh [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=82CDEC496AE9AD63FCCEBD0C@nimrod.local \
    --to=alex@alex.org.uk \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).