Semaphore / Synchronizing write operations

"vsaavedra" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
I created my agentX agent using the v5 handler-based API.

This agent will be use by many applications to populate a MIB tree.

To do this, the application must retrieve the last entry of a table, and with that number, perform some work and them populate the next entry.

 

My problem is: When two applications try to update de MIB at same time, it's possible that one application rewrite the data that other application just wrote.

 

How can I guarantee that two applications can't update the same node at the same time.

Can I implement a kind of semaphore or  implement a synchronization of write operation?

 

I presume that I can use a strategy like that, using the XXXTable_handler(netsnmp_mib_handler *handler,

                             netsnmp_handler_registration *reginfo,

                             netsnmp_agent_request_info *reqinfo,

                             netsnmp_request_info *requests) 

 

Any suggestion ?

 

Thanks in advance!

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.