qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v2 1/4] block: extract AIO_WAIT_WHILE() from Blo


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v2 1/4] block: extract AIO_WAIT_WHILE() from BlockDriverState
Date: Thu, 15 Feb 2018 08:15:38 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 02/15/2018 04:12 AM, Kevin Wolf wrote:
Having acquired the AioContext does not make this function return true.
The semantics are:
1. Current thread is the IOThread that runs the AioContext
2. Current thread is the main loop and the AioContext is the global
    AioContext.

The function tests whether the current thread is the "native" or "home"
thread for this AioContext.  Perhaps we could also call it the "poller"
thread because only that thread is allowed to call aio_poll(ctx, true).

   if (aio_context_in_native_thread(ctx)) {
       ...
   } else {
       ...
   }

What do you think?

"home" or "native" both work for me. Or if we want to keep the name
short, maybe just changing the order and s/iothread/thread/ would be
enough: bool in_aio_context_thread(AioContext *ctx) - do you think that
would still be prone to misunderstandings?

in_aio_context_home_thread() sounds slightly better than in_aio_context_thread(), but swapping the verb makes a nice difference where either name is better than what we currently have.

--
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3266
Virtualization:  qemu.org | libvirt.org



reply via email to

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