Lazy g_main_loop()

Kyryll A Mirnenko aka Mirya mirya at zoc.com.ua
Thu Sep 20 10:31:35 EDT 2007


I'm trying to integrate the libpurple (actually for its AIM implementation) 
with a multithreaded frontend. There's one strange problem i'm observing: the 
frontend tries to send a message, so it passes the "task" a a callback to the 
main loop like this:

g_idle_add_full(G_PRIORITY_DEFAULT, (GSourceFunc)sendMessageCb, data, NULL);

sendMessageCb simply sends it via the libpurple; the problem is it takes a 
long time for this callback to be executed, so i get this:
1) after g_idle_add_full() it takes up to 30 seconds to enter the 
sendMessageCb
2) if some external input is being done (there's no GUI in my case, so it's 
only about some network event to libpurple) the sendMessageCb is processed 
immediately - looks like external input works as a catalyst
3) setting the first argument to G_PRIORITY_HIGH gives nothing - the effect is 
the same
4) after g_idle_add_full() is called and before sendMessageCb is entered 
there's no debug log from libpurple
5) the only account activated (online) is an AIM one
6) Linux, FC5, 2.6 kernel, glibc 2.4, glib 2.10.3

So the question is: where those 30 sec go and how to eliminate this gap?

-- 
Regards, Mirya
ICQ #313898202




More information about the Devel mailing list