On Thu, 2006-01-26 at 12:29 +0200, Michael G wrote:
> Regarding option 2, I can't see how can I cache only the indexes.
> Consider the following scenario:
>       * Caching the indexes.
>       * The internal module data changes (The dynamic indexes change
>         too).
>       * Getting a request from NMS station.
>       * Trying to fetch index that is no longer exist ??? 

Then invalidate the cache, and reload the index information.
You can then try processing the request again.

Caching the indexes basically helps you when:

  a) The internal module data has not changed since
     the cache was last loaded, or
  b) The internal module data has changed, but the
     list of valid rows has not.


> 2. Algorithm 2:
> Using a copy (cache) of the indexes and the data. 
> Update the cache when you receive some signal from the module that the
> data was changed (when available) or on a time basis. (Hold access to
> data while refreshing the cache and assure data is valid).

That's basically the model used by the cache helper, and any table
helpers that can use it (including MfD, iterator, tdata, etc).

Not responding to an external signal, though that wouldn't be
too difficult to implement - but updating (or at least releasing)
the cache when it's regarded as "too old".


> (Do I have an option to reload the cache without using a timer event?)

Just call the routine "netsnmp_check_cache_and_reload()"



> Also I would like to know if there is a way to use a scheme that
> generates a cache driven code but without all this code mass that is
> produced by the mfd option.

Most of the table helpers can use the cache helper.
Try

    mib2c -S cache=1 -c mib2c.table_data.conf  myTable

and look at the template generated.
(I'm not 100% sure that this is the right syntax, but I think it is).

Dave



-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to