2008/6/30 <[EMAIL PROTECTED]>:
> ..... But i am not sure where all to use mutexs.
> I am using mutexes in following places :
> updateCurrentAlarmTable_MyOwnMethod()
> initialize_table_currentAlarmTable()
>
> Do i also need to take lock on following methods provided by netsnmp
> currentAlarmTable_set_reserve1()
> currentAlarmTable_set_reserve2()
> currentAlarmTable_set_action()
> currentAlarmTable_set_commit()
> currentAlarmTable_set_free()
> currentAlarmTable_set_undo()
> currentAlarmTable_get_value()
> as they also access CONTAINER
Bear in mind that I am not an expert in multi-threaded programming.
But I would expect that you would need a mutex lock around *every*
bit of code that works with row data obtained from the table container,
That's the code in your MIB module *and* any similar code within
the relevant handler routines.
I am not familiar with the module framework you are using,
but I would expect that most of the places you mention would
indeed need to be protected.
The question to bear in mind throughout is:
"would it matter if updateCurrentAlarmTable_MyOwnMethod()
cleared all the rows from the table at this precise moment?"
If the table being emptied would break a given section of code,
then that code needs to be protected.
Or at least, that's my understanding.
Someone who actually knows about such things might be
able to advise you differently.
Dave
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders