[packagekit] Limiting to one extra thread
Richard Hughes
hughsient at gmail.com
Fri Apr 25 08:08:35 PDT 2008
On Fri, 2008-04-25 at 22:33 +1000, David Timms wrote:
> Richard Hughes wrote:
> > The current PK threaded backend design allows backends to create as many
> > threads as they like for each transaction. This complicates the thread
> > management greatly. I'm suggesting that we limit each transaction to one
> > thread, and then we can rip out a whole chunk of code.
> >
> > Anyone got any problems with that?
> I understand the complexity of making threaded stuff work correctly, but
> I have been hoping for a long time that package updating could
> essentially be done in two threads:
>
> 1. to get required packages in order of least to most difficult - eg an
> update to timezone should be downloaded before an update that requires a
> heap of other packages to be updated at the same time.
>
> 2. to install packages in small groups once all packages needed by that
> update are installed {eg openoffice*} etc, rather than waiting for all
> packages to complete download.
Ahh, that doesn't need two threads, it just needs the transaction to do
the sane thing in the single thread. You only need two threads when you
need to, for instance, build the cache and download the package at the
same time. The daemon probably won't do the right thing in this case, so
it's probably better to download the cache, /then/ download the package
so we can give the user a coherent state of what's going on.
To do the openoffice-* usecase you describe earlier, you can already do
that in the backend - if you chose to. I'm not sure the additional
complexity (and all that depsolving on each package) would be worth the
small saving in download space. Backends are free to do this if they
wish tho.
Richard.
More information about the PackageKit
mailing list