Windows: Redesign daemon thread queue management
authorJeffrey Altman <jaltman@your-file-system.com>
Thu, 19 Jan 2012 06:21:02 +0000 (01:21 -0500)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 19 Jan 2012 23:48:43 +0000 (15:48 -0800)
commit201c954a36fe6ec19f96e4c8e24e6e080c3ba55a
treefbe051a3313ebe077b23a85970b263e85b24714e
parentafeb3c3a83ed0869e4a70b0725e3f85713330c3a
Windows: Redesign daemon thread queue management

The daemon thread worker pool has some very poor properties.
The threads spend a significant amount of time polling for
ready to process tasks because so frequently a store/fetch data
request is accompanied by many other requests for the same FID
that would block.

Lets try a new approach. Create one queue for each worker thread
and assign the tasks to a thread by a hash of the FID.  This ensures
that all tasks for a single FID are serialized and prevents multiple
threads from attempting to perform the same task only to decide that
the thread would be forced to block.

Change-Id: I1d00ba0df1aa646e05b2cb3cb0796629f2e6d233
Reviewed-on: http://gerrit.openafs.org/6575
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@secure-endpoints.com>
Tested-by: Jeffrey Altman <jaltman@secure-endpoints.com>
src/WINNT/afsd/cm_callback.c
src/WINNT/afsd/cm_daemon.c
src/WINNT/afsd/cm_daemon.h