On 03.01.2012 19:45 Robert Story said the following:
> On Tue, 27 Dec 2011 14:58:03 +0100 Michael wrote:
> MS>  What I need is a framework where I add my 26 rows at init time and every
> MS>  GET request will lookup the values in the shared memory (which is
> MS>  continously updated from a different process).
> MS>
> MS>  Is there such a framework available?
>
> Yep, MFD can do that if you set the right options.
>
> First, you want a container cache. Set the following flags:
>
>      cache->flags |=
>          (NETSNMP_CACHE_DONT_AUTO_RELEASE | NETSNMP_CACHE_DONT_FREE_EXPIRED
>           | NETSNMP_CACHE_DONT_FREE_BEFORE_LOAD | NETSNMP_CACHE_PRELOAD
>           | NETSNMP_CACHE_DONT_INVALIDATE_ON_SET);
>
> That will just load the cache once, where you just need to set up the indexes.
>
> Then, if you have one call that gets all the data for a given row, you can use
> the row_prep function to load your data as needed for a given row. If you have
> individual calls for each piece of data, you can lookup the data in the 
> xxx_get
> functions.
>

Thanks for this information.

In the meantime I have rewritten my subagent using the table_date 
framework without using the cache. It looks very good now.
But I will save your info if I need to go back to the MFD implementation.

Thanks
Michael


------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create 
new or port existing apps to sell to consumers worldwide. Explore the 
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to