On Fri, Apr 19, 2024 at 04:49 PM +0200, Marc Hartmayer <mhart...@linux.ibm.com> 
wrote:
> Use a worker pool for processing the events (e.g. udev, mdevctl config 
> changes)
> and the initialization instead of a separate initThread and a mdevctl-thread.
> This has the large advantage that we can leverage the job API and now this
> thread pool is responsible to do all the "costly-work" and emitting the 
> libvirt
> nodedev events.
>
> Signed-off-by: Marc Hartmayer <mhart...@linux.ibm.com>
> ---

[…snip…]

>  
> +    /* must be initialized before trying to reconnect to all the running 
> mdevs
> +     * since there might occur some mdevctl monitor events that will be
> +     * dispatched to the worker pool */
> +    priv->workerPool = virThreadPoolNewFull(1, 1, 0,
> nodeDeviceEventHandler,

The more I think about the number of workers in this pool, the more I'm
convinced that it's (currently) important to use only _one_ worker (1
udev thread <-> 1 worker), because otherwise we don't have any
guarantees that we comply to the following:

order(udev_events) == order(libvirt nodedev events)

And I guess we would like to fulfill this guarantee.

If you agree, then we should add a comment to the code and if needed we
can implement something for the case #count > 1.

[…snip]

-- 
Kind regards / Beste Grüße
   Marc Hartmayer

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Wolfgang Wendt
Geschäftsführung: David Faller
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
_______________________________________________
Devel mailing list -- devel@lists.libvirt.org
To unsubscribe send an email to devel-le...@lists.libvirt.org

Reply via email to