qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 4/4] iothread: push gcontext earlier in the thre


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 4/4] iothread: push gcontext earlier in the thread_fn
Date: Fri, 22 Feb 2019 10:24:36 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 22/02/19 07:57, Peter Xu wrote:
> On Fri, Feb 22, 2019 at 07:37:02AM +0100, Marc-André Lureau wrote:
>> Hi
>>
>> On Fri, Feb 22, 2019 at 4:14 AM Peter Xu <address@hidden> wrote:
>>>
>>> We were pushing the context until right before running the gmainloop.
>>> Now since we have everything unconditionally, we can move this
>>> earlier.
>>>
>>> One benefit is that now it's done even before init_done_sem, so as
>>> long as the iothread user calls iothread_create() and completes, we
>>> know that the thread stack is ready.
>>>
>>
>> This will change the default context in the iothread, for code running
>> there. This may not be a good idea. Until now, only sources dispatched
>> from iothread_get_g_main_context() would have default context
>> associated to it.
>>
>> I don't know if the current behaviour is intentional, but it has some
>> logic. With this change, you may create hidden races, by changing the
>> default context of sources to the iothread.
> 
> Yes I agree that the behavior will be changed in this patch that even
> if the iothread user does not use the gcontext they'll also have the
> context set.  I would think it should be ok because IMHO events hooked
> onto the aio context should not depend on the gcontext, but indeed I'd
> like to get some confirmation from others, especially the block layer.

The block layer does not use GSource at all.

Paolo




reply via email to

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