[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 08/51] chardev: introduce qemu_chr_timeout_add_ms
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-devel] [PULL 08/51] chardev: introduce qemu_chr_timeout_add_ms() |
Date: |
Tue, 16 Jan 2018 14:43:11 +0000 |
User-agent: |
Mutt/1.9.1 (2017-09-22) |
On Tue, Jan 16, 2018 at 03:16:50PM +0100, Paolo Bonzini wrote:
> From: Peter Xu <address@hidden>
>
> It's a replacement of g_timeout_add[_seconds]() for chardevs. Chardevs
> now can have dedicated gcontext, we should always bind chardev tasks
> onto those gcontext rather than the default main context. Since there
> are quite a few of g_timeout_add[_seconds]() callers, a new function
> qemu_chr_timeout_add_ms() is introduced.
FYI the point of using g_timeout_add_seconds() is that it allow the
glib event loop to be more efficient. It ensures that all timers
which second granularity are dispatched on the same iteration of
the main loop. IOW, if you have 10 timers registered with
g_timeout_add_seconds() the main loop wakes up once a second and
runs all 10 of them. If you have 10 timers registered with g_timeout_add
the main loop wakes up 10 times a second, at a different time for each
timer.
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-devel] [PULL 03/51] pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine type, (continued)
- [Qemu-devel] [PULL 03/51] pc: fail memory hot-plug/unplug with -no-acpi and Q35 machine type, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 01/51] scsi-generic: Add share-rw option, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 02/51] scsi: fix scsi_convert_sense crash when in_buf == NULL && in_len == 0, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 04/51] hpet: recover timer offset correctly, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 10/51] build-sys: silence make by default or V=0, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 06/51] chardev: use backend chr context when watch for fe, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 11/51] build-sys: add a rule to print a variable, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 05/51] i386/cpu/kvm: look at PMU's CPUID before setting MSRs, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 07/51] chardev: let g_idle_add() be with chardev gcontext, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 08/51] chardev: introduce qemu_chr_timeout_add_ms(), Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 12/51] build-sys: compile with -Og or -O1 when --enable-debug, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 14/51] tests/docker: add test-debug, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 09/51] build-sys: fix qemu-ga -pthread linking, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 17/51] readline: add a free function, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 13/51] tests/docker: add some sanitizers to fedora dockerfile, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 15/51] tests: fix check-qobject leak, Paolo Bonzini, 2018/01/16
- [Qemu-devel] [PULL 16/51] vl: fix direct firmware directories leak, Paolo Bonzini, 2018/01/16