Hi,

thanks for the fast answer!

[EMAIL PROTECTED] wrote:
RS> On Sun, 27 Jun 2004 15:20:49 +0200 Arne wrote:
AB>> I'm using the array-user template to implement a table. 
AB>> Was the structure freed because
AB>> the original thread was killed after finished with startup?

RS> Use of threads in the agent is unsupported.
RS> Try and get it working as a single thread first, and we'll help with any issues
RS> you have. Then you can try to switch over to multi-threaded, if you really
RS> want. But large portions of the agent library are not thread-safe.

Sorry, thats not what I meant. I try to make my problem clear:

 - I'm reading my config on startup in a structure.
 - I'm including a pointer in the row context, so I can access the
   structure from the callbacks
 - When I'm in the callbacks, the structure and its data is gone.

So thats what I meant with thread - I don't know where the callback
gets called from and was speculating that the daemon is using thread
or whatever. I haven't used a thread, yet.

So is there a better way to get custom data to the callbacks? shm?
BTW, I'm talking about netsnmp_table_array_callbacks.


AB>> An other question: after successful set, I want to write the config to
AB>> disk. This my take a little while (or not, depending on the system).
AB>> Whats the best way to do so?

RS> The simplest way would be to just write it after the commit phase. It will,
RS> however, block further processing until the write is complete. If that's an
RS> issue, you might be able to use a worker thread.
RS> The only exception to the 'no threads' rule in the agent is for threads which
RS> don't do any snmp related stuff. So stuff the config data in shared memory, and
RS> kick off a thread to read the config in shared memory and write it to disk.

I planned to do so, thanks. I will test with that blocking write - if
it will show up that it's too slow, I write an own thread for this.


Warm regards,
Arne Brutschy



-------------------------------------------------------
This SF.Net email sponsored by Black Hat Briefings & Training.
Attend Black Hat Briefings & Training, Las Vegas July 24-29 - 
digital self defense, top technical experts, no vendor pitches, 
unmatched networking opportunities. Visit www.blackhat.com
_______________________________________________
Net-snmp-coders mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to