Re: Semaphore / Synchronizing write operations

This is a discussion on Re: Semaphore / Synchronizing write operations within the SNMP Users forums, part of the Networking and Network Related category; With your help, I managed to implement the lock mechanism :-D But, after some tests, I realize I need to ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Users

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-23-2007
vsaavedra
 
Posts: n/a
Default Re: Semaphore / Synchronizing write operations

With your help, I managed to implement the lock mechanism :-D



But, after some tests, I realize I need to improve this mechanism.



I'm thinking in the following approach :



Instead of using a spinlock scalar, this object will be a leaf in a table.
But to do this, I will have to modify the handler for that table with the
following algorithm:



mainTable_handler(netsnmp_mib_handler *handler, ..)

{

If(column is the spinlockObject)

{

case MODE_SET_RESERVE1:

if ( spinLockValue != table.spinlockLeaf)

netsnmp_set_request_error(reqinfo, requests,
SNMP_ERR_WRONGVALUE);

break;



case MODE_SET_ACTION:

Table.spinlockLeaf ++;

}

}



Does this make any sense ? :-D



----- Original Message -----
From: "Dave Shield" <D.T.Shield@liverpool.ac.uk>
To: "vsaavedra" <vsaavedra@maisis.pt>
Cc: <net-snmp-users@lists.sourceforge.net>
Sent: Tuesday, October 23, 2007 3:48 PM
Subject: Re: Semaphore / Synchronizing write operations


> On 23/10/2007, vsaavedra <vsaavedra@maisis.pt> wrote:
> > When using a spinlock aproach, should I do :
> >
> > snmpset -v 2c -c public localhost SpinLockObject i 0 MyLeaf i 1

>
> No.
>
> First of all, the spinLockObject is a scalar object, so you need
> to give the OID of the (sole) instance - i.e. spinLockObject.0
>
> Secondly, you need to give the correct spin-lock value - not 0.
> Otherwise the SET will fail. That's the whole point of a spin-lock.
>
> I suggest you re-read the description of the TestAndIncr syntax
> (in the SNMPv2-TC MIB)
>
> Dave
>
> -------------------------------------------------------------------------
> 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
> Net-snmp-users@lists.sourceforge.net
> Please see the following page to unsubscribe or change other options:
> https://lists.sourceforge.net/lists/...net-snmp-users
>



-------------------------------------------------------------------------
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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:06 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0