[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v6 22/27] qmp: isolate responses into io thread
From: |
Fam Zheng |
Subject: |
Re: [Qemu-devel] [RFC v6 22/27] qmp: isolate responses into io thread |
Date: |
Thu, 21 Dec 2017 20:57:02 +0800 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, 12/19 16:45, Peter Xu wrote:
> For those monitors who has enabled IO thread, we'll offload the
s/has/have/
> responding procedure into IO thread. The main reason is that chardev is
> not thread safe, and we need to do all the read/write IOs in the same
> thread. For use_io_thr=true monitors, that thread is the IO thread.
>
> We do this isolation in similar pattern as what we have done to the
> request queue: we first create one response queue for each monitor, then
> instead of reply directly in main thread, we queue the responses and
s/reply/replying/
s/main thread/the main thread/
> kick the IO thread to do the rest of the job for us.
>
> A funny thing after doing this is that, when the QMP clients send "quit"
> to QEMU, it's possible that we close the IOThread even earlier than
> replying to that "quit". So another thing we need to do before cleaning
> up the monitors is that we need to flush the response queue (we don't
> need to do that for command queue; after all we are quitting) to make
> sure replies for handled commands are always flushed back to clients.
>
> Signed-off-by: Peter Xu <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
- [Qemu-devel] [RFC v6 18/27] monitor: send event when command queue full, (continued)
- [Qemu-devel] [RFC v6 18/27] monitor: send event when command queue full, Peter Xu, 2017/12/19
- [Qemu-devel] [RFC v6 19/27] qapi: introduce new cmd option "allow-oob", Peter Xu, 2017/12/19
- [Qemu-devel] [RFC v6 20/27] qmp: export qmp_dispatch_check_obj and allow "id", Peter Xu, 2017/12/19
- [Qemu-devel] [RFC v6 21/27] qmp: support out-of-band (oob) execution, Peter Xu, 2017/12/19
- [Qemu-devel] [RFC v6 22/27] qmp: isolate responses into io thread, Peter Xu, 2017/12/19
- Re: [Qemu-devel] [RFC v6 22/27] qmp: isolate responses into io thread,
Fam Zheng <=
- [Qemu-devel] [RFC v6 23/27] monitor: enable IO thread for (qmp & !mux) typed, Peter Xu, 2017/12/19
- [Qemu-devel] [RFC v6 24/27] qmp: add command "x-oob-test", Peter Xu, 2017/12/19
- [Qemu-devel] [RFC v6 25/27] docs: update QMP documents for OOB commands, Peter Xu, 2017/12/19
- [Qemu-devel] [RFC v6 26/27] tests: qmp-test: verify command batching, Peter Xu, 2017/12/19
- [Qemu-devel] [RFC v6 27/27] tests: qmp-test: add oob test, Peter Xu, 2017/12/19