Re: [PATCH 0/1] [V3] Add Cache in GrlNet



On Tue, 2011-03-15 at 16:54 +0100, Iago Toral Quiroga wrote: 
> > As example, if one instance changes the maximum cache size, it will be
> > reflected on all instances.
> 
> Some random ideas that come to my mind: 1) Not all the plugins need the
> same cache size. 2) The more network based plugins you have, the bigger
> the cache size should be 3) Each plugin could estimate a reasonable
> cache size for it to work properly.
> 
> With these ideas in mind, I wonder if the API to control the size of the
> cache should be so that the plugins declare their needed cache size once
> on startup (for example), and grilo (wc in this case) adds this value to
> the default cache size.
> 
> With this approach the size of the cache adapts to the size demanded by
> the plugins and every plugin has the chance to request the size it
> needs.

Note that as now the cache is shared among the plugins, we can't set a
size per instance.

But something we could do that I think would fix the problem is that the
setting size will use the biggest value requested.

That is, if plugin1 demands as most 5Mb and plugin2 demands 10Mb, the
final size would be 10Mb, because it is the biggest size to use.

Another alternative could be adding the sizes, so if one asks for 5Mb
and another asks for 10Mb, the final size would be 15Mb.

Regarding doing it in the constructor, well, I don't have a big
preference: I think plugins can create the GrlNet instance and after
that set the cache size. But if you think it'd be good to have a
grl_net_wc_new_with_cache(guint size) I can do it.

	J.A.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]