On Thu, 28 Oct 2004 09:39:43 +0100 Dave wrote:
DS> Robert> Ok, lets see if I got this right. You have the main agent thread,
DS> Robert> and two worker threads. The worker threads don't do any SNMP other
DS> Robert> than to call send_v2trap. Is that right?
DS> 
DS> Gary> Yep you got it.
DS> 
DS> Urk!  I'm not sure that's safe.
DS> 
DS> As far as I remember, doesn't the 'send_trap_vars' mechanism use the
DS> same (non-thread-safe) set of APIs as the incoming request handling?
DS> I'd expect this to suffer from problems between generating traps
DS> and receiving incoming requests.
DS> 
DS> In order for that to work safely, wouldn't it be necessary to rework
DS> the 'send_trap_vars' code to use the SSI approach instead?
DS> 
DS> All of the locking that you talk about sounds to be aimed at a different
DS> area of potential conflict.  I'm not at all sure that you're protected
DS> against races within the SNMP library itself.

Dave's right. If you were using the mutexes such that only one thread at a time
was doing SNMP, you'd probably be ok. But if the main thread isn't blocked
while the worker thread is doing it's trap thing, and you get an incoming
request to the main thread, you've got two threads accessing the same data.

The odds of getting a request while sending/processing traps may be low, but
when it does happen, it could cause problems.

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

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


-------------------------------------------------------
This SF.Net email is sponsored by:
Sybase ASE Linux Express Edition - download now for FREE
LinuxWorld Reader's Choice Award Winner for best database on Linux.
http://ads.osdn.com/?ad_id=5588&alloc_id=12065&op=click
_______________________________________________
Net-snmp-users mailing list
[EMAIL PROTECTED]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to