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

dominik.vogt at external.thalesgroup.com dominik.vogt at external.thalesgroup.com
Thu Nov 25 08:05:33 CET 2010


There is a series of small patches attached to this message.

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.

0003-*

  Do not block threads in EventListHolder::SNMPProcessEvents().

  With the old code, threads would block in SNMPProcessEvents()
  while another thread was running in the loop in that function.
  This would eventually lead to a situation where one thread was
  processing the loop and all others were blocking, freezing the
  system.

  With the patch, only one thread will process the loop and other
  threads will signal that more work is to be done to the looping
  thread and then return from the function without blocking.  This
  should improve responsiveness with high workloads.

0004-*

  This improves the shutdown responsiveness of Snmp++.

  Break out of processPendingEvents() if m_eventList.Done() is
  true.  There was no way to break out of stopping the loop in
  processPendingEvents(), so it might have taken take a long time
  before processing stops after SNMPExitMainLoop() or
  stop_poll_thread() is called.

The patches have been tested for several months without any
problems in my setup.

Note:  The patches are based upon each other and must be applied
in the correct order.

Ciao

Dominik ^_^  ^_^

-- 

Dominik Vogt
-------------- next part --------------



More information about the AGENTPP mailing list