Rather than running them in the thread pool shared between all
in a process.
GTask thread pool can lead to livelocks if too many tasks
are running at once and all of them end up blocking on another operation
which also uses the
GTask thread pool. The combination of the
following factors can commonly reproduce this livelock problem:
GTaskthread pool only has 14 spaces.
- DNS lookups via
GResolverare run in the
GTaskthread pool (unless using a version of GLib with glib!3397 (merged)).
- All pending tasks depend on network I/O at some point, which is the case for most gnome-software jobs.
Eventually, this will be fixed by no longer using old-style plugin jobs:
new-style plugin jobs either execute asynchronously in the main thread
or run in plugin-specific worker threads, and hence don’t consume
GTask resources. See #1472.
It’s going to take a few more cycles to finish off #1472, however, so in
the meantime we can eliminate the bottleneck on the constrained
thread pool by running old-style plugin jobs in a custom thread pool.
Signed-off-by: Philip Withnall firstname.lastname@example.org
Fixes: #2105 (closed)