gtkroomlist responsiveness

Gabriel Schulhof nix at go-nix.ca
Sun Jan 6 11:11:37 EST 2008


On Sun, 2008-01-06 at 11:10 -0500, Sadrul Habib Chowdhury wrote:
> * Gabriel Schulhof had this to say on [06 Jan 2008, 15:46:59 +0200]:
> > The use of while(g_main_context_iteration(NULL, FALSE)); as in the patch
> > below makes gtkroomlist much more responsive (read: usable) on slow
> [snip]
> > +
> > +       while(g_main_context_iteration(NULL, FALSE));
> 
> Perhaps you can explain why this patch makes it more responsive? There
> might be other cleaner fixes to the problem.

Because it gives the main loop a chance to process UI-related events,
like scrollbar actions initiated by the user, paint requests initiated
by the tree view and the progress bar, etc.

Considering Sean's response, I'm wondering if there's a
GLIB_CHECK_VERSION() beyond which there's no thread reentrancy issue.

> > Since pidgin_roomlist_add_room() is a UI op called fairly one-to-one
> > from the core (i.e., the core passes it straight through from the prpl),
> > one idea might be to place the second "while(g_main_..." line into the
> > core after the call to the UI op, rather than at the end of the UI op.
> 
> Nope. This can't be done in the core since it assumes the use of the
> GLib mainloop, which isn't a requirement for libpurple (this is the same
> reason functions like g_idle_add etc. can't be used in the core).

Aha, OK.



Gabriel




More information about the Devel mailing list