[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC] [PATCHv8 11/30] aio / timers: Add a notify callba
From: |
Alex Bligh |
Subject: |
Re: [Qemu-devel] [RFC] [PATCHv8 11/30] aio / timers: Add a notify callback to QEMUTimerList |
Date: |
Fri, 9 Aug 2013 15:16:50 +0100 |
On 9 Aug 2013, at 10:02, Stefan Hajnoczi wrote:
> When looking at thread-safety I had to think about set_notify_cb() for a
> while. The issue is that we add the timerlist to the clock source's
> ->timerlists *before* notify_cb has been assigned.
>
> This could be a problem is another thread re-enables the clock source
> while we are still in timerlist_new().
>
> In practice it is not an issue when AioContexts are created under the
> global mutex (that's the case today).
>
> Still, it would be a little safer to drop set_notify_cb() and instead
> pass in cb/opaque in timerlist_new().
This is good idea. I will do that.
--
Alex Bligh
[Qemu-devel] [RFC] [PATCHv8 02/30] aio / timers: add qemu-timer.c utility functions, Alex Bligh, 2013/08/08
[Qemu-devel] [RFC] [PATCHv8 10/30] aio / timers: Add QEMUTimerListGroup to AioContext, Alex Bligh, 2013/08/08
[Qemu-devel] [RFC] [PATCHv8 11/30] aio / timers: Add a notify callback to QEMUTimerList, Alex Bligh, 2013/08/08
[Qemu-devel] [RFC] [PATCHv8 12/30] aio / timers: aio_ctx_prepare sets timeout from AioContext timers, Alex Bligh, 2013/08/08
[Qemu-devel] [RFC] [PATCHv8 13/30] aio / timers: Add aio_timer_new wrapper, Alex Bligh, 2013/08/08