]> git.proxmox.com Git - mirror_frr.git/commit - lib/thread.c
lib: Thread scheduler should be fair and not let events starve I/O and timers
authorPaul Jakma <paul@quagga.net>
Mon, 11 Jan 2010 16:33:07 +0000 (16:33 +0000)
committerPaul Jakma <paul@quagga.net>
Wed, 8 Dec 2010 16:53:09 +0000 (16:53 +0000)
commit2613abe64fe48761d798942af8dc0ec90c804b22
treec0f75f40bbd005bdd9d5545209a9402715c4f381
parent8526100eebf9c56ff6fac2b80938b232bb687946
lib: Thread scheduler should be fair and not let events starve I/O and timers

* thread.c: (thread_fetch) the current scheduler will service events
  indefinitely, ignoring I/O and timers, so long as there are events.
  In other words, events can crowd out I/O and timers.  In theory this
  shouldn't be a huge problem as events are generated only by timers
  and I/O, however in practice it means normal-load behaviour is not as
  useful a predictor of high-load behaviour as it should be.

  Fix this by considering all the kinds of threads, in every run of the
  scheduler.  For any given run, we prioritise events, however across
  runs the scheduler should be fair.

  This has been observed to give more stable inter-packet times in
  testing of ospfd (i.e.  lower std-dev).

 (thread_process) new heler to queue all the given threads onto the ready
 list
lib/thread.c