]> git.evergreen-ils.org Git - OpenSRF.git/commit
Rearrange the way that a listener juggles its drones.
authorscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 22 Jun 2010 04:23:09 +0000 (04:23 +0000)
committerscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Tue, 22 Jun 2010 04:23:09 +0000 (04:23 +0000)
commitb9b88eacac9031f35ebc07f538e4665ac19a7416
treeae89c5a6a96b8f6f4864f6c8185d425c3af419d9
parentd6192ffe7eb29c85ad99f792dc02a0b5ab4679ec
Rearrange the way that a listener juggles its drones.

Instead of maintaining a single circular linked list including both active
processes and idle processes, keep the active drones in the circular list
and the idle drones in a separate linear list; move them back and forth
as needed.  This change simplifies how we search for drones when we need
them, because we don't have to skip over ones that we don't want.

The list of idle drones acts as a stack.  When we look for an idle drone
for a new request, we pick the one at the head of the list, which is the
last one to have become idle.

As a result, we pick the drone that is most likely still to be in memory.

In the old arrangment, the list acted as a queue.  When picking an idle
drone, we picked the one that had been idle the longest -- which was the
one most likely to have been swapped out.

Also: added a number of doxygen-style comments, and tinkered with the
white space here and there.

Note: an earlier commit tried to make similar changes, but it had to be
backed out because it mangled the linkage pointers in some situations,
leading to segfaults.  That problem has now been corrected.

M    src/libopensrf/osrf_prefork.c

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1967 9efc2488-bf62-4759-914b-345cdb29e865
src/libopensrf/osrf_prefork.c