i have look how to implement a snmp sub-agent with the net-snmp library (http://net-snmp.sourceforge.net/tutorial/tutorial-5/toolkit/demon/index.html)
The exemple works well, but i am asking a question about the variable passed in reference in "netsnmp_register_int_instance(&variable)"
This variable is read when a snmp request is recevieved by the snmp deamon wich ask the "agentx" to ask to the subagent to give the value of the variable.
But how about Locks? i am going to link the subagent with my ownbinary to permit him giving informations about its states each seconds.
Sometimes it will be possible that the variable is being read by snmp library code while being writen by my own code?
i must modify the code of the snmp library blocks which read the variable to set a lock?
Thank you.