Leaked source code of windows server 2003
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.

35 lines
1.2 KiB

  1. /*++
  2. Copyright (c) 1995 Microsoft Corporation
  3. Module Name:
  4. inc\worker.h
  5. Abstract:
  6. Header for worker threads for the router process
  7. Revision History:
  8. Gurdeep Singh Pall 7/28/95 Created
  9. --*/
  10. //* Typedef for the worker function passed in QueueWorkItem API
  11. //
  12. typedef VOID (* WORKERFUNCTION) (PVOID) ;
  13. DWORD QueueWorkItem (WORKERFUNCTION functionptr, PVOID context) ;
  14. // The following defines are included here as a hint on how the worker thread pool is managed:
  15. // The minimum number of threads is Number of processors + 1
  16. // The maximum number of threads is MAX_WORKER_THREADS
  17. // If work queue exceeds MAX_WORK_ITEM_THRESHOLD and we have not hit the max thread limit then another thread is created
  18. // If work queue falls below MIN_WORK_ITEM_THRESHOLD and there are more than minimum threads then threads are killed.
  19. //
  20. // Note: changing these flags will not change anything.
  21. //
  22. #define MAX_WORKER_THREADS 10 // max number of threads at any time
  23. #define MAX_WORK_ITEM_THRESHOLD 30 // backlog work item count at which another thread is kicked off
  24. #define MIN_WORK_ITEM_THRESHOLD 2 // work item count at which extra threads are killed