[compiz] Plugin Library Interface

Mike Dransfield mike at blueroot.co.uk
Wed Mar 7 09:36:44 PST 2007


Danny Baumann wrote:
>> Other than being notified when it is added or removed I
>> don't see how it is beneficial.  Using a library would mean
>> that the functionality could always be guaranteed.
>>     
>
> There might be functionality which isn't needed to be guaranteed. The
> animation subplugins were an example, the text plugin is another. Some
> person might think that he doesn't need text display, so he can simply
> disable it.
>   

It could also be disabled with an option, or at compile time.

If it was a really big library then you could use dlopen, but this 
is just one function.

>> I also think that your symbol lookup table could get really
>> slow if there were more than 20 functions loaded, have you
>> done any benchmarks on this?
>>     
>
> Why should it be slow? Of course, plugins using library plugin functions
> shouldn't look them up everytime they use it, but instead store a
> function pointer when their updateLibraryPlugin routine is called.
>
>   

It would be slower than the alternative of just compiling this
one function in, simply because there would be no need to
update their function pointers.

Plugins would take longer to load.  I cannot see how this method
would ever be quicker (overall it is taking more resources).

> Can you please elaborate on your concerns about slowness (see my
> argument above), possibility of crashes (a versioning scheme could be
> used) and incompatibility?
>
>   

I do not think that such tight coupling of plugins will lead
to a stable system.  The plugins should be unaware of each
other as much as possible.  I do not see an awful lot of benefits
over standard linking methods.  Adding a versioning scheme just
sounds like you are reinventing the wheel.

There is incompatibility between compiz and beryl.  All that
needs to be done is rip the textToPixmap function from text
and add it to whatever plugin you want to draw text.  It provides
the same functionality with very little overhead.  Then all the extra
functions you have added will be removed.  Will the user be able to
notice a difference?

All you seem to have here is a beryl specific dynamic library
loader.  If dlopen is too hard, then couldn't you write wrappers
to make that easier?  That way everyone could benefit from your
hard work.




More information about the compiz mailing list