[SNMP4J] Safely executing TreeUtils.getSubtree in concurrent threads

Nigel Thomas nigel.thomas at preferisco.com
Thu Jun 19 19:32:55 CEST 2014


Hi

I have a system with multiple threads getting different SNMP subtrees from
the same target server concurrently using TreeUtils.getSubtree. One thread
alone seems to work exactly as expected, but when a second thread starts up
the two get confused; the first table receives no data.

Clearly I am having some sort of thread safety problem - but with which
object/method? I am using
- a singleton instance of Snmp
- a single instance of CommunityTarget (for each monitored server -
currently just localhost)
- therefore a single instance of TransportMapping - a
DefaultUdpTransportMapping; I have tried
setAsyncMsgProcessingSupported(true)
- a separate instance of TreeUtils per thread
- SNMPv2
- snmp4j-2.3.0

Any thoughts would be very welcome

TIA

Nigel



More information about the SNMP4J mailing list