qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/5] threadpool: add thread_pool_new() and threa


From: Paolo Bonzini
Subject: Re: [Qemu-devel] [PATCH 2/5] threadpool: add thread_pool_new() and thread_pool_free()
Date: Wed, 06 Mar 2013 17:36:28 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130219 Thunderbird/17.0.3

Il 06/03/2013 16:45, Stefan Hajnoczi ha scritto:
> +    if (pool->ctx) {
> +        aio_set_event_notifier(pool->ctx, &pool->notifier, NULL, NULL);
> +    } else {
> +        qemu_aio_set_event_notifier(&pool->notifier, NULL, NULL);
> +    }

I have the same complaint about ->ctx here.  I think it's nicer to pick
the right context in the creation function rather than every time you
use pool->ctx (allowing to pass in NULL is fine).

Also, when you drop the global ThreadPool each pool is guaranteed to
have an AioContext and the special casing can be dropped completely.

Paolo



reply via email to

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