Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

186 lines
6.0 KiB

  1. To-Do List for LKRhash
  2. ======================
  3. TESTING
  4. =======
  5. * Write a C test, to directly test the C API. HashTest half does
  6. it, as it can use the public API and TypedHashTable.
  7. * Build a publicly distributable test program, as a sample for
  8. customers. E.g., a dictionary component for ASP.
  9. * hashtest: modify so that each thread can work on a completely
  10. separate hashtable, instead of sharing a global
  11. hashtable. This will allow us to discover the maximum possible
  12. scaling, which is probably less than the `ideal' scaling,
  13. #CPUs * 1-thread-perf.
  14. * hashtest\kernel: split into driver and usermode test
  15. program. Usermode test program should take care of parsing the
  16. arguments and loading the test data into memory, then use an
  17. ioctl to pass it down to the kernel driver. The only code in
  18. the kernel driver,apart from LKRhash itself, should be the goo
  19. to crack the ioctl and DriverEntry. Usermode should print
  20. results.
  21. * Better tests for ApplyIf family
  22. KERNEL-MODE
  23. ===========
  24. * kernel locks: should they block at all? consider implications
  25. if running on some usermode program's thread.
  26. * Fix global objects in driver, including the global list of
  27. tables
  28. * implement kernel-mode version of !lkrhash
  29. * Think about running at DISPATCH_LEVEL instead of
  30. PASSIVE_LEVEL. Which functions should be pageable
  31. vs. non-pageable? Memory allocators? Lock types?
  32. * Use <zwapi.h>?
  33. * Memory allocation pool is a parameter for LKRhash
  34. public constructors, but it's ignored. Need virtual base for
  35. allocators?
  36. * DONE: Control debug spew: provide some way of setting
  37. g_fDebugOutputEnabled
  38. LOCK IMPLEMENTATION
  39. ===================
  40. * WriteLock: make all return a value instead of `void' that's
  41. passed into WriteUnlock. Ditto for ReadLock, etc. Needed for
  42. CKSpinLock and OldIrql. <sigh/>
  43. * Put delays into the inner loop of the spins, to see if that
  44. reduces cache sloshing
  45. * Enable per-class instrumentation for locks, as opposed to the
  46. current all-or-nothing system for per-lock
  47. instrumentation. Mostly present already, just needs a little
  48. factoring.
  49. * Locks code. Move all member function implementations and enums
  50. into locks.cpp. Locks.h should be opaque declarations only.
  51. * Rewrite a few key functions, such as CSmallSpinLock::WriteLock
  52. or CReaderWriterLock3::ReadOrWriteLock, in x86 assembler
  53. * Build locks as a separate statically linked library
  54. * Refcount the initialization/cleanup routines?
  55. * Move CKSpinLock, CEResource, and CFastMutex into <Locks.h>
  56. * DONE: Sprinkle KeEnterCriticalRegion (and KeLeaveCriticalRegion)
  57. in the various locks, to prevent APCs being delivered that might
  58. suspend the thread that holds the lock.
  59. MISCELLANEOUS
  60. =============
  61. * Reduce the three versions of LKRhash in IIS6 to just this one.
  62. * Currently, we key the number of subtables off LK_TABLESIZE
  63. times a function of the number of CPUs. However, we only need
  64. a lot of subtables under two circumstances: (a) many millions
  65. of elements (esp. on Win64, where total number of elements
  66. might exceed 2^32), or (b) high contention. There isn't
  67. necessarily a correlation between large table size and high
  68. contention. With the multi-reader locks, high contention only
  69. arises if there are a lot of insertions/deletions. If the
  70. table is not modified much after it's built, contention
  71. shouldn't be an issue and there's little advantage to having a
  72. lot of subtables.
  73. * Provide a DeleteKey variant that returns a pointer to the
  74. record that is being removed from the table.
  75. * Make AddRefRecord return the new reference count.
  76. * Inline the array of pointers to subtables within
  77. CLKRHashTable, instead of dynamically allocating it.
  78. * Inline _FindBucket by hand into Delete(Key|Record),
  79. InsertRecord, and Find(Key|Record).
  80. * Factor out memory stuff into LKR-mem.cpp
  81. * Add some instrumentation: #allocs, #expands, #contracts, etc.
  82. * Add some flags to LKR_Initialize: default size, output
  83. tracing, etc
  84. * Should ApplyIf(LKP_DELETE) call the Action function before
  85. deleting? Or add LKP_PERFORM_DELETE[_STOP]
  86. * Add debug print routines for the other enumerations and for
  87. lock state to LKRhash.
  88. * Experiment with having no bucket locks whatsoever, just
  89. subtable locks. This should make operations a little faster,
  90. but presumably will hurt multiprocessor scalability
  91. * Implement fMultiKeys to provide support for multiple,
  92. identical keys. Needed for EqualRange, hash_multiset, and
  93. hash_multimap. See CLKRLinearHashTable::_InsertRecord for
  94. details on what needs to be changed.
  95. * Provide implementations of the STL collection classes:
  96. hash_map, hash_set, hash_multimap, and hash_multiset. Must
  97. provide full implementation of STL iterator semantics
  98. (pair<key,value>)
  99. * const_iterators for STL-style iterators
  100. * consider providing some kind of implicit locking with
  101. STL-style iterators
  102. * Add version.subversion number to CLKRLinearHashTable
  103. * Build lkrhash as a separate statically linked library
  104. * Better Statistics: #buckets, density, by subtable
  105. * Experiment with new hash function from Paul Larson.
  106. * Public API in LKR-hash.h: remove dependency on irtlmisc.h and
  107. irtldbg.h
  108. * Use IsBadCodePtr to validate callback functions
  109. * Make exception-safe. What happens if callback routines
  110. (AddRefRecord/ExtractKeys or ApplyIf) access violate (throw an
  111. SEH exception) or throw a C++ exception? Table and bucket
  112. locks won't be released, state variables may be corrupted,
  113. etc. LKRhash code should never throw any kind of exception
  114. * Add some kind of auto object for readlocking or writelocking a
  115. table, so that the table automatically gets unlocked by
  116. auto-obj's destructor.
  117. * Use auto_ptrs.
  118. * Port to C# (Chris Tracy has started on this).
  119. Andre Rosenthal has started a port to Managed C++
  120. * Make LKRhash available as a static library as well as a DLL
  121. * DONE: break apart lkrhash.cpp: iterators, applyif, stats, etc
  122. * DONE: Always step forward through all subtables, to avoid
  123. possible deadlock, when acquiring subtable locks
  124. * DONE: Test new contraction algorithm.
  125. * DONE: sublocks for ApplyIf
  126. * DONE: Provide a C API wrapper