qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [RFC v2 3/5] timer: make qemu_clock_enable sync between


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [RFC v2 3/5] timer: make qemu_clock_enable sync between disable and timer's cb
Date: Tue, 30 Jul 2013 12:12:14 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7

Il 30/07/2013 11:51, Alex Bligh ha scritto:
> As far as walking the QEMUTimerList itself is concerned, this is
> something which is 99.999% done by the thread owning the AioContext.
> qemu_clock_enable should not even be walking this list. So I don't
> see why the protection here is needed.

The protection is needed not because of qemu_clock_enable, but rather
because of code in qemu_clock_enable's caller.  Such code likely expects
not to run concurrently with timers.

qemu_clock_enable however can be called from other threads than the one
owning the AioContext.  Furthermore, it can happen while timer callbacks
are being called, because callbacks are called without holding any lock.

If you put together these conditions, qemu_clock_enable has to wait for
timer callbacks to finish running before returning.

Paolo



reply via email to

[Prev in Thread] Current Thread [Next in Thread]