[SNMP4J] Is SNMP4J safe for multiple threads concurrently using the same instance of class "Snmp" ?

Frank Fock fock at agentpp.com
Thu Dec 16 00:51:15 CET 2010


Hi,

You can use sync requests within concurrent
threads with the same Snmp instance,
but make sure that you use different PDU
objects.

Async request processing would be the most
efficient approach in most cases then.

Simply forget the MultiThreadedMessageDispatcher.
When you need it, you will know it. Otherwise,
you should not use it (because of its overhead
and additional complexity).

Best regards,
Frank

On 15.12.2010 05:12, Bh, Guruprasad (NSN - IN/Bangalore) wrote:
> Hi All,
>
> Currently we are using the snmp.send(pdu, target) which is synchronous
> mode of executing in SNMP4J.
> The method call blocks untill the response is available from the NE, and
> the response is returned to the method.
>
> Now we are planning to execute the snmp.send(pdu, target) in multiple
> threads with single instance of "snmp", So
> Is SNMP4J safe for multiple threads concurrently using the same instance
> of class "Snmp" ?
>
> Or can we move to different approach that is, SNMP4J in asynchronous
> mode
> Using the Snmp.send(...,...,ResponseListener)  family of methods !!
>
> Also can any one explain why we need to use
> MultiThreadedMessageDispatcher instead of the default
> MessageDispatcherImpl ?
> Will it be thread-safe ?
>
> Can anyone explain on this ?
>
> Best Regards
> Guruprasad B H
> Nokia Siemens Networks
> Operations Suppport Systems - Research and Development
> COO OBS OSS RD OPL AMF MF2
>
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/snmp4j

-- 
AGENT++
http://www.agentpp.com
http://www.snmp4j.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the SNMP4J mailing list