[AGENT++] MIB lock

Frank Fock fock at agentpp.com
Wed May 17 00:57:17 CEST 2006


Hi Robert,

Robert Voigt wrote:
> Hi list,
> 
> I have several MibLeafs whose requests take long to process, and while
> they are processed get requests on other leafs are being blocked. I
> suspect they are blocked in the line
> lock_mib();
> in
> Mib::process_request()
> because the lock of the MIB is held by the request on the leaf that
> still hasn't finished.

Yes, that is how AGENT++ has been designed.
If you need to improve concurrency then you
will have to change the design of the long running
MIB objects (leafs).

> 
> I have observed this behavior with a set request and with a get request
> on a table. With the set request the MIB is blocked when a second set
> request comes before the first one has finished. With the get request on
> the table the MIB is blocked as long as MibTable::update() hasn't
> finished.
> 
> For my agent it is not acceptable that get requests on all leafs are
> blocked for so long. Of course there are two reasons for this and two
> ways to fix it. 
> 1. Certain requests take too long to process, so I could change the
> architecture of my agent software and make them quicker.

Yes, but another option would be to make them asynchronous.

> 2. The MIB is blocked by certain requests without a reason that is
> apparrent to me. After all it uses a thread pool for the requests, so I
> would expect all request to be processed asynchronously (increasing the
> size of the thread pool does not help). Or is there a reason for this
> behaviour? Are my observations correct? What does is take to change it?

When using GETNEXT/GETBULK to access MIB objects, the objects
and even objects not in the addressed view have to scanned. In case
of tables, a blocking operation on one row can affect a read
operation on another row or object. That is probably what you
are observing. The reason for this is a clean and save multi-threading
concept, which needs to avoid dead-locks.

To avoid blocking operations, use GET operations where possible and
implement all long running operations asynchronously.

Best regards,
Frank

> 
> I think I have Agent++ version 3.5.20a.
> 
> Any help would be very much appreciated.
> 
> Robert
> 
> 
> _______________________________________________
> AGENTPP mailing list
> AGENTPP at agentpp.org
> http://lists.agentpp.org/mailman/listinfo/agentpp

-- 
AGENT++
http://www.agentpp.com
http://www.mibexplorer.com
http://www.mibdesigner.com




More information about the AGENTPP mailing list