[packagekit] Forked and Threaded

Richard Hughes hughsient at gmail.com
Sun Mar 9 12:21:42 PDT 2008


On Sun, 2008-03-09 at 14:27 +0100, Sebastian Heinlein wrote:
> 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.

Sure, you can use either, I don't really mind as long as one works :-)

> 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.

Sure, but when we ask the backend to Cancel() it means we just don't
care about the results, and so if possible they shouldn't be sent. The
daemon is clever enough not to proxy requests for cancelled
transactions, but I think you might get an error in this case. Either
way, it's probably best to cancel stuff when asked, even if it's quick.

> 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.
> 
> 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 think I'm hitting this with testdbus in the self check code.

Richard.





More information about the PackageKit mailing list