diff options
Diffstat (limited to 'src/zenutil/include')
| -rw-r--r-- | src/zenutil/include/zenutil/workerpools.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/zenutil/include/zenutil/workerpools.h b/src/zenutil/include/zenutil/workerpools.h index 78a8e5c5e..9683ad720 100644 --- a/src/zenutil/include/zenutil/workerpools.h +++ b/src/zenutil/include/zenutil/workerpools.h @@ -6,14 +6,20 @@ namespace zen { +enum class EWorkloadType +{ + Burst, // Used when you want to respond quickly, such as requests from a client + Background // Used for background jobs such as GC/Scrub/oplog import-export +}; + // Worker pool with std::thread::hardware_concurrency() worker threads, but at least one thread -WorkerThreadPool& GetLargeWorkerPool(); +WorkerThreadPool& GetLargeWorkerPool(EWorkloadType WorkloadType); // Worker pool with std::thread::hardware_concurrency() / 4 worker threads, but at least one thread -WorkerThreadPool& GetMediumWorkerPool(); +WorkerThreadPool& GetMediumWorkerPool(EWorkloadType WorkloadType); // Worker pool with std::thread::hardware_concurrency() / 8 worker threads, but at least one thread -WorkerThreadPool& GetSmallWorkerPool(); +WorkerThreadPool& GetSmallWorkerPool(EWorkloadType WorkloadType); // Special worker pool that does not use worker thread but issues all scheduled work on the calling thread // This is useful for debugging when multiple async thread can make stepping in debugger complicated |