From: Peter Xu <peterx@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: qemu-devel@nongnu.org,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the thread_fn
Date: Fri, 8 Mar 2019 11:05:23 +0800 [thread overview]
Message-ID: <20190308030523.GC16479@xz-x1> (raw)
In-Reply-To: <20190307144039.GG2843@stefanha-x1.localdomain>
On Thu, Mar 07, 2019 at 02:40:39PM +0000, Stefan Hajnoczi wrote:
> On Wed, Mar 06, 2019 at 07:55:31PM +0800, Peter Xu wrote:
> > + /*
> > + * We should do this as soon as we enter the thread, because the
> > + * function will silently fail if it fails to acquire the
> > + * gcontext.
> > + */
> > + g_main_context_push_thread_default(iothread->worker_context);
>
> I have a hard time understanding this comment. The mention of how it
> fails makes me think "we'll never find out about failures anyway, so how
> does it help to call this early?".
>
> I suggest sticking to the point that this function must always be called
> first:
>
> /*
> * g_main_context_push_thread_default() must be called before anything
> * in this new thread uses glib.
> */
>
> Now people will think before moving this function call.
Sorry to be confusing; this looks good to me. Please let me know if
you want me to repost this patch alone or the patchset with the change.
Thanks,
--
Peter Xu
next prev parent reply other threads:[~2019-03-08 3:05 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-06 11:55 [Qemu-devel] [PATCH v2 0/5] iothread: create gcontext unconditionally Peter Xu
2019-03-06 11:55 ` [Qemu-devel] [PATCH v2 1/5] iothread: replace init_done_cond with a semaphore Peter Xu
2019-03-07 3:09 ` Peter Xu
2019-03-06 11:55 ` [Qemu-devel] [PATCH v2 2/5] iothread: create the gcontext unconditionally Peter Xu
2019-03-06 11:55 ` [Qemu-devel] [PATCH v2 3/5] iothread: create main loop unconditionally Peter Xu
2019-03-06 11:55 ` [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the thread_fn Peter Xu
2019-03-07 14:40 ` Stefan Hajnoczi
2019-03-08 3:05 ` Peter Xu [this message]
2019-03-06 11:55 ` [Qemu-devel] [PATCH v2 5/5] iothread: document about why we need explicit aio_poll() Peter Xu
2019-03-06 12:59 ` Marc-André Lureau
2019-03-08 10:21 ` [Qemu-devel] [PATCH v2 0/5] iothread: create gcontext unconditionally Stefan Hajnoczi
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=20190308030523.GC16479@xz-x1 \
--to=peterx@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@gmail.com \
--cc=stefanha@redhat.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).