[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v3 10/27] monitor: create monitor dedicate iothrea
From: |
Peter Xu |
Subject: |
Re: [Qemu-devel] [RFC v3 10/27] monitor: create monitor dedicate iothread |
Date: |
Wed, 8 Nov 2017 19:35:32 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Wed, Nov 08, 2017 at 07:18:44PM +0800, Fam Zheng wrote:
> On Wed, 11/08 15:25, Peter Xu wrote:
> > On Tue, Nov 07, 2017 at 03:11:31PM +0800, Fam Zheng wrote:
> > > On Mon, 11/06 17:46, Peter Xu wrote:
> > > > +static GMainContext *monitor_io_context_get(void)
> > > > +{
> > > > + return iothread_get_g_main_context(mon_global.mon_iothread);
> > > > +}
> > > > +
> > > > +static void monitor_iothread_init(void)
> > > > +{
> > > > + mon_global.mon_iothread = iothread_create("monitor_iothread",
> > > > + &error_abort);
> > > > + /*
> > > > + * GContext in iothread is using lazy init - the first time we
> > > > + * fetch the context we'll have that initialized.
> > > > + */
> > > > + monitor_io_context_get();
> > >
> > > Why do you need an eager init here?
> >
> > I thought putting this line with IOThread creation will make it more
> > clear that the IOThread is using GMainContext polling. I am not that
> > strong to keep it, but I would prefer.
>
> The "iothread only starts using GMainContext polling after the lazy init
> happens" is completely opaque to its user, so I don't think there is anything
> but confusion to have this.
Makes sense. Let me remove it.
--
Peter Xu
- [Qemu-devel] [RFC v3 07/27] monitor: move the cur_mon hack deeper for QMP, (continued)
[Qemu-devel] [RFC v3 11/27] monitor: allow to use IO thread for parsing, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 12/27] qmp: introduce QMPCapability, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 13/27] qmp: negociate QMP capabilities, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 14/27] qmp: introduce some capability helpers, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 15/27] monitor: introduce monitor_qmp_respond(), Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 16/27] monitor: let monitor_{suspend|resume} thread safe, Peter Xu, 2017/11/06
[Qemu-devel] [RFC v3 17/27] monitor: separate QMP parser and dispatcher, Peter Xu, 2017/11/06