[AGENT++] [PATCH] SNMP++: Improve responsiveness of snmp++

dominik.vogt at external.thalesgroup.com dominik.vogt at external.thalesgroup.com
Thu Nov 25 08:28:12 CET 2010


On Thu, Nov 25, 2010 at 08:05:33AM +0100, Dominik Vogt wrote:
>    0001-*
> 
>      This fixes a bug in the use of the select() function.  The
>      current code assumes, that the timeval parameter to select() is
>      not modified by the call to select().  This is not true on Linux
>      and possibly other platforms.  So it is important to
>      reinitialize the tv before each call to select().
> 
>    0002-*
> 
>      Removes the delay in the select loop in
>      SNMPProcessPendingEvents().
> 
>      The current delay in each pass of the loop just degrades
>      performance and serves no purpose.  The loop is broken as soon
>      as none of the file descriptors are busy, so the "busy wait"
>      scenario that the delay was supposed to prevent can not occur
>      anyway.

Note that on Linux, the delay removed by 0002-* did not work
anyway because of the bug fixed by 0001-*.  On Linux, the timeval
is modified by select() in such a way, that the stored value
reflects the portion of the timeout that is still remaining.  Once
this value becomes zero, select always returns immediately which
is exactly what the code tried to prevent.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt



More information about the AGENTPP mailing list