[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the t
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the thread_fn |
Date: |
Thu, 7 Mar 2019 14:40:39 +0000 |
User-agent: |
Mutt/1.11.3 (2019-02-01) |
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.
Stefan
signature.asc
Description: PGP signature
- [Qemu-devel] [PATCH v2 0/5] iothread: create gcontext unconditionally, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 1/5] iothread: replace init_done_cond with a semaphore, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 2/5] iothread: create the gcontext unconditionally, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 3/5] iothread: create main loop unconditionally, Peter Xu, 2019/03/06
- [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the thread_fn, Peter Xu, 2019/03/06
- Re: [Qemu-devel] [PATCH v2 4/5] iothread: push gcontext earlier in the thread_fn,
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH v2 5/5] iothread: document about why we need explicit aio_poll(), Peter Xu, 2019/03/06
- Re: [Qemu-devel] [PATCH v2 0/5] iothread: create gcontext unconditionally, Stefan Hajnoczi, 2019/03/08