[packagekit] Forked and Threaded

Robin Norwood rnorwood at redhat.com
Mon Mar 10 08:56:01 PDT 2008


On Sun, 09 Mar 2008 14:27:40 +0100
Sebastian Heinlein <glatzor at ubuntu.com> wrote:

> Servus,
> 
> I would like to keep the threaded approach for the apt2 backend,
> since I see the following problem with forking: You cannot change the
> cache of the parent process, since all the work is done in the child
> process.
> 
> The search of the apt2 backend is very fast and so isn't an interface
> blocker. In the end I only want to allow to cancel the downloading
> part.
> 
> So Robin, would you please take a look at the forked-dbus-backend
> branch? The decorator should work for you and even simplify your code.

The @forked decorator looks good at first glance - I'm checking it out
now.  I'd like to use the threaded version, too, but rpm is expressly
*not* thread-safe. We're keeping all the yum stuff confined to
a process already, so it might be ok. I'll have to check with our rpm
guys.

> By the way doesn't it make more sense to exit the main loop of the
> child process right at the beginning? AFAIK this way you don't get
> into the situation that the child processes DBus calls.

Yes, I don't know why it wasn't doing that already - thanks for
catching that.

-RN

-- 
Robin Norwood
Red Hat, Inc.

"The Sage does nothing, yet nothing remains undone."
-Lao Tzu, Te Tao Ching



More information about the PackageKit mailing list