Skip to content
  • Peter Xu's avatar
    a5ed3525
    monitor: allow using IO thread for parsing · a5ed3525
    Peter Xu authored
    
    
    For each Monitor, add one field "use_io_thr" to show whether it will be
    using the dedicated monitor IO thread to handle input/output.  When set,
    monitor IO parsing work will be offloaded to the dedicated monitor IO
    thread, rather than the original main loop thread.
    
    This only works for QMP.  HMP will always be run on the main loop
    thread.
    
    Currently we're still keeping use_io_thr off always.  Will turn it on
    later at some point.
    
    One thing to mention is that we cannot set use_io_thr for every QMP
    monitor.  The problem is that MUXed typed chardevs may not work well
    with it now. When MUX is used, frontend of chardev can be the monitor
    plus something else.  The only thing we know would be safe to be run
    outside main thread so far is the monitor frontend. All the rest of the
    frontends should still be run in main thread only.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Message-Id: <20180309090006.10018-10-peterx@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    [eblake: squash in Peter's followup patch to avoid test failures]
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
    a5ed3525
    monitor: allow using IO thread for parsing
    Peter Xu authored
    
    
    For each Monitor, add one field "use_io_thr" to show whether it will be
    using the dedicated monitor IO thread to handle input/output.  When set,
    monitor IO parsing work will be offloaded to the dedicated monitor IO
    thread, rather than the original main loop thread.
    
    This only works for QMP.  HMP will always be run on the main loop
    thread.
    
    Currently we're still keeping use_io_thr off always.  Will turn it on
    later at some point.
    
    One thing to mention is that we cannot set use_io_thr for every QMP
    monitor.  The problem is that MUXed typed chardevs may not work well
    with it now. When MUX is used, frontend of chardev can be the monitor
    plus something else.  The only thing we know would be safe to be run
    outside main thread so far is the monitor frontend. All the rest of the
    frontends should still be run in main thread only.
    
    Signed-off-by: default avatarPeter Xu <peterx@redhat.com>
    Message-Id: <20180309090006.10018-10-peterx@redhat.com>
    Reviewed-by: default avatarEric Blake <eblake@redhat.com>
    [eblake: squash in Peter's followup patch to avoid test failures]
    Signed-off-by: default avatarEric Blake <eblake@redhat.com>
Loading