On Mon, 28 Mar 2005 18:38:31 +0800 (CST) [EMAIL PROTECTED] wrote:
LMCC>   Since there are at least two threads running in
LMCC> snmpd: the main thread which handles SNMP requests and
LMCC> the event listening thread, we must make sure snmpd
LMCC> could run thread-safely.

No, snmpd is not thread safe.

LMCC>   I use callback mechanism(SNMP_CALLBACK_LIBRARY and
LMCC> SNMP_CALLBACK_SESSION_INIT) to let snmpd create a
LMCC> thread which will listen user defined events and
LMCC> update the global cache or generate traps according to
LMCC> the analysis of these events. The global cache is user
LMCC> defined and it's used in the MIB handlers.

The only way to use snmpd in a multi-threaded application is to keep ALL snmp
functionality in ONE thread. Other threads may listen for non-snmp related
events, and notify the snmpd thread that a trap needs to be sent, but the trap
itself must be sent from the snmpd thread.

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to