[packagekit] Run pkclient action from thread

Daniel Nicoletti dantti85-pk at yahoo.com.br
Mon Apr 19 06:23:38 PDT 2010


>With a Qt4 GUI, the Qt application does - of course - not 
> call g_type_init(), so I didn't get any error.

You didn t get any error because you are witting a Qt4 GUI?
If so there is a Qt lib already just in case you don t know
(and a kde frontend :P )

best,

 ________________________________
Daniel Nicoletti - KDE Developer
http://dantti.wordpress.com
When a wicked man dies, his hope perishes;
all he expected from his power comes to nothing. Prov. 11:7



----- Mensagem original ----
> De: Matthias Klumpp <matthias at nlinux.org>
> Para: PackageKit users and developers list <packagekit at lists.freedesktop.org>
> Enviadas: Segunda-feira, 19 de Abril de 2010 9:02:11
> Assunto: Re: [packagekit] Run pkclient action from thread
> 
> On Mon, 19 Apr 2010 10:28:45 +0100, Richard Hughes <
> ymailto="mailto:hughsient at gmail.com" 
> href="mailto:hughsient at gmail.com">hughsient at gmail.com>
wrote:
> 
> That's exactly why the PkClient is asynchronous. You don't have to run
> 
> it in a thread to get a non-blocking UI, you just connect up the Gio
> 
> completion and then do other stuff while the client is waiting for a
> 
> response from the server. Have a look at the gnome-packagekit code for
> 
> an example.
I do it that way now - the threading was some kind of experiment, 
> doing the
PackageKit actions asynchronously is much better.

> 
> 
> I think it would be a good idea to try to identify the original
> 
> freeze. If you could point to the code I can certainly have a look.
Thank 
> you! But I recently discovered the reason for the error: The library
called 
> g_type_init() to intialize the GType-System. I removed the line, but
forgot 
> that the function was also called in another place of the lib. (It
was some 
> crap left by two committed patches. I reverted the second one,
which caused 
> some other errors and left the first, which brought the
duplicate 
> function)
With a Qt4 GUI, the Qt application does - of course - not 
> call
g_type_init(), so I didn't get any error. But the GTK+ GUI does it. 
> A
doubled call of g_type_init() caused this strange error.
My testsuite 
> for the bindings did not throw an error, because the call was
disabled with a 
> compilerswitch. I really don't know why this happened
exactly (Why does GLib 
> not throw a warning if g_type_init() was already
called?), but the issue is 
> fixed now and I learned to check 3rd-party
patches a little bit more 
> carefully, especially if they are cluttered.

> It's likely the thread 
> has blocked and is not processing further
> methods to the daemon. This 
> may be a threading bug in dbus-glib, or it
> may be a thread issue with 
> your code.
It seems glib has blocked the application somehow... Or it did 
> something to
the mainloop... Maybe I find a GLib developer to explain how 
> this exactly
happened and why it did not happen on Fedora 12 (the reason why 
> I never saw
this bug)
Sorry for bothering you with something which was 
> actually my fault, but I
thought the PackageKit log messages could give me at 
> least a little hint.
I skip the stupid threading experiments and go back to 
> the previous
solution.
Thank you for your friendly help!
  
> Matthias

_______________________________________________
PackageKit 
> mailing list

> href="mailto:PackageKit at lists.freedesktop.org">PackageKit at lists.freedesktop.org

> href="http://lists.freedesktop.org/mailman/listinfo/packagekit" target=_blank 
> >http://lists.freedesktop.org/mailman/listinfo/packagekit


      




More information about the PackageKit mailing list