[wanproxy/wanproxy] 7ba254: Simplify CallbackThread scheduling.

Juli Mallett juli at clockworksquid.com
Mon Feb 22 11:04:11 PST 2016


  Branch: refs/heads/master
  Home:   https://github.com/wanproxy/wanproxy
  Commit: 7ba254f725ba5bc8119acd0e334333762640af18
      https://github.com/wanproxy/wanproxy/commit/7ba254f725ba5bc8119acd0e334333762640af18
  Author: Juli Mallett <juli at clockworksquid.com>
  Date:   2016-02-22 (Mon, 22 Feb 2016)

  Changed paths:
    M event/callback.cc
    M event/callback.h
    M event/callback_thread.cc
    M event/callback_thread.h

  Log Message:
  -----------
  Simplify CallbackThread scheduling.

We make 'select' a method of CallbackThread, rather than doing all the
work in the main body, and have it try everything in the list looking
for a viable interlock.  This avoids modifying the list, and makes the
logic simpler overall, as well as making dropping in other scheduling
algorithms much simpler.


  Commit: 37cc319b0a1f0304ea476207b286457c4850a137
      https://github.com/wanproxy/wanproxy/commit/37cc319b0a1f0304ea476207b286457c4850a137
  Author: Juli Mallett <juli at clockworksquid.com>
  Date:   2016-02-22 (Mon, 22 Feb 2016)

  Changed paths:
    M event/callback.cc
    M event/callback.h
    M event/callback_thread.cc
    M event/callback_thread.h

  Log Message:
  -----------
  Use an embedded list for scheduled callbacks.

This avoids allocations for containers in the hot path.  This uses a
very simple double-ended queue, but could easily use a tailq to speed
the process of appending if we wanted, but it doesn't seem worth the
effort at this time -- the impact is quite minimal.


Compare: https://github.com/wanproxy/wanproxy/compare/10d98cbebc3d...37cc319b0a1f


More information about the wanproxy mailing list