Changed the way pending requests are stored in an osrfAppSession.
authorscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 1 Jan 2010 14:49:16 +0000 (14:49 +0000)
committerscottmk <scottmk@9efc2488-bf62-4759-914b-345cdb29e865>
Fri, 1 Jan 2010 14:49:16 +0000 (14:49 +0000)
commit1930805fe99909a8ee1ff98c755c9f3327037478
tree5c93631dbd7d47555ed863c1a554ebca789d4ea4
parent77ef6f1922527d70e34ec5db6dbbeade3069d010
Changed the way pending requests are stored in an osrfAppSession.

Before, pending requests were stored in a so-called request_queue.
However it wasn't a queue at all, except in name.  It was an
osrfList, i.e. an expandable pointer array used as a random
access container.  Request ids were used as subscripts into the
array.

Since we don't reuse request ids (except in the theoretical case
of a wraparound), the array grew without limit.  This unbounded
growth in the memory footprint could create problems for a
long-running busy process.  It might have contributed to the
rumored instabililty of chopchop, our homegrown Jabber server.

Now, pending requests are stored in a hash table, where each
of 64 slots holds a doubly linked list.  There should be no
effect on performance unless there are hundreds or thousands
of pending requests at once, in which case we would probably
get bogged down anyway.

M    include/opensrf/osrf_app_session.h
M    src/libopensrf/osrf_app_session.c

git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1881 9efc2488-bf62-4759-914b-345cdb29e865
include/opensrf/osrf_app_session.h
src/libopensrf/osrf_app_session.c