[Kst] Plugin local data

George Staikos staikos at kde.org
Fri Feb 6 05:35:11 CET 2004


On Thursday 05 February 2004 11:19, you wrote:
> On Thursday 05 February 2004 01:12 am, George Staikos wrote:
> >    I implemented the interface for plugin local data, but I'm wondering
> > what your preferences are with respect to this.  Here is how it works:
> >
> > - in the XML file, add a node <localdata/> to specify that you want the
> > pointer
> > - your function must now take a parameter at the end "void**".  If you
> > don't specify the localdata node, you MUST NOT add the new parameter.
> >
> > Now my question for everyone is, do you prefer to have one such pointer
> > for each instance of the plugin (total=n for n plugins), or one such
> > pointer for ALL instances of the plugin (total=1)?
>
> The applications I can think of (eg, persistent averaging of data) would
> benefit from n for n plugins (one for each instance).  I can't off hand
> think of why it would be useful to have data shared between instances.

   I can think of one use but I'm not sure if it's worthwhile.  Sharing of 
large tables.  If a plugin requires some sort of large table (say > 1MB), 
then 10 instances will use loads of RAM.  Shared memory is an option, but 
then there will be issues if we go multithreaded for updating (we'll have to 
be sure that no plugin is run while another instance of that plugin is 
running).

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/



More information about the Kst mailing list