FYI: 4.7 panel and plugins

Brian J. Tarricone bjt23 at cornell.edu
Tue May 26 09:27:08 CEST 2009


On 05/25/2009 11:42 PM, Nick Schermer wrote:

> FYI: g_thread_init should also be called before using GSlice, which is
> used by gobject, so it cannot hurt to call it all the time.

I really hope you'll reconsider this.  Calling g_thread_init() requires 
that a program is linked to libgthread, which requires that the program 
is linked to libpthread.  Libpthread replaces a large number of libc 
functions with (slower) thread-safe versions, which obviously isn't 
necessary in a non-threaded applications.  This also slows app startup 
since the dynamic linker has to work harder (not just to load extra 
libraries, but to override existing symbols in the GST).

Also I believe that some glib/gobject stuff is slower when in threaded 
mode due to some extra required locking.

Is all this significant?  I don't know; I've never profiled it.  But why 
add extra overhead and extra startup time when it's not necessary?

g_thread_init() is absolutely *not* required in a gslice-using 
application if the application does not use threads.

Having plugins not know if they're external or internal is somewhat nice 
from an implementation perspective[1], but this is an abstraction that 
really shouldn't be there.

	-brian

[1] Or not really... 3rd-party plugins (and even most 1st-party ones) 
should never be internal.  I might even go so far to suggest that there 
should be *no* exported internal plugin interface, and the few plugins 
that can/should be internal that are distributed with the panel itself 
use an unpublished API.  On the other hand... is there a need for 
internal plugins at all?  Would there be much of a performance/resource 
usage impact if (for example) the launcher plugin was made external?



More information about the Xfce4-dev mailing list