On 02/23/2010 03:47 AM, Robert Story wrote: > On Mon, 22 Feb 2010 23:02:54 +0100 Gerlando wrote: > GF> Or are you suggesting I don't even create a new container type (and use > GF> the standard container to keep just the indexes of the existing rows, > GF> and then use that information in my own handler (i.e, the one is passed > GF> to netsnmp_create_handler_registration())? > > Yes, I think that's what he means. > Dave, is that so? How would I add the indexes to the snmp_container though (if, for instance, rows are added from another thread)? I would have to make the other threads SNMP-aware, which is not something I'd love to do.
> GF> In that case, how would I handle locking anyway? I don't see any > GF> suitable injection point... > > That's a tricky one... especially if you have multiple tables, since a single > request could have varbinds for different tables... I think you probably want > to have each handler check for something that you put in the agent list for > the reqinfo structure (see netsnmp_agent_get_list_data() and friends), and if > it doesn't exist, set the lock and add it. The think that you add should have > a custom free_func function (see data_list.h), which should release the lock. > The delete function should only be called once the request is finished > processing, no matter how many tables are in the request. > That's an interesting suggestion, thanks! This would allow me to lock the entire database for each request. I was thinking I could also do something more fine-grained, i.e., locking each table (and that I could do with different objects in the agent list, one for each table). Or, I might want to add something per-row (i.e., a data pointer!). How can I do that? Do I need to inject something like the Row Merge handler? Thanks! Gerlando ------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
