[AGENT++] Thread safety (new SNMP session in each thread)

Jochen Katz katz at agentpp.com
Wed Feb 27 22:17:15 CET 2013


Hi,

> I have tested SNMP++ code in a scenario where I call the function
> below simultaneously in different threads:

there is no problem with this fucntion, but I would recommend to share
the Snmp object between the threads or at least only create it once for
each thread and reuse it. With your code, a new UDP port is opened (and
closed) for each request.

> I don't get any problems so far, however I'm confused by the
> discussion here:
> https://groups.google.com/forum/?fromgroups=#!topic/comp.protocols.snmp/9boOuteEwY4.

This is a very old discussion and it is no longer valid. You can now
share a Snmp object between several threads to send requests.

Regards,
  Jochen


More information about the AGENTPP mailing list