Template:FAQ:Agent 12

From Net-SNMP Wiki
Jump to: navigation, search

With care.

As mentioned in the earlier "thread-safe" FAQ entry, the Net-SNMP agent (including the AgentX subagent) has not been designed for threaded operation. In particular, it makes use of various global variables without attempting to protect them against simultaneous use. This means that it is NOT safe to have SNMP or AgentX related processing in two separate threads. This also applies to handling GET (and SET) processing in one thread, and generating traps in another. This is still vulnerable to the usual threading problems.

However, as long as all of the SNMP-related activity is limited to the one thread, then there should be no reason why this cannot safely communicate with other threads within the same application, using private (thread-safe) mechanisms.

But in terms of the Net-SNMP-provided code, the agent (and AgentX subagent) should not be regarded as thread-safe.