|
threadman 0.1.0
Header-only C++23 managed threads, dynamic pools, futures, and executors
|
Central feature-gate header for ThreadMan's optional integrations and tunable defaults. More...

Go to the source code of this file.
Macros | |
| #define | THREADMAN_PLATFORM_LINUX 0 |
| #define | THREADMAN_PLATFORM_APPLE 0 |
| #define | THREADMAN_PLATFORM_OTHER 1 |
| #define | THREADMAN_WITH_NLOHMANN_JSON 0 |
| #define | THREADMAN_WITH_PARCEL 0 |
| #define | THREADMAN_RECENT_TASKS_CAPACITY 256 |
| Per-pool recent-task ring-buffer capacity. | |
| #define | THREADMAN_DEFAULT_POOL_NAME "tm::default" |
Name used by ThreadManager::default_pool(). | |
| #define | THREADMAN_DEFAULT_SCALE_UP_WAIT_MS 50 |
| How long the oldest queued task is allowed to wait before forcing a scale-up (milliseconds). | |
| #define | THREADMAN_DEFAULT_IDLE_TIMEOUT_MS 30000 |
| Idle-timeout window: a non-core worker that sees no work for this long retires (milliseconds). | |
| #define | THREADMAN_DEFAULT_SCALE_UP_QUEUE_THRESHOLD 4 |
| Queue-depth threshold above which the housekeeper considers scaling up. | |
| #define | THREADMAN_DEFAULT_SCALE_CHECK_INTERVAL_MS 100 |
| Housekeeper tick interval / per-pool scale evaluation cadence (ms). | |
| #define | THREADMAN_DEFAULT_STUCK_TASK_THRESHOLD_MS 60000 |
A task that has been Running longer than this is flagged as stuck (ms). | |
| #define | THREADMAN_DEFAULT_SUMMARY_INTERVAL_MS 1000 |
| Periodic ManagerSummary cadence — listener publish interval (ms). | |
| #define | THREADMAN_DEFAULT_FUTURE_WAIT_SCALE_UP_WAIT_MS 10 |
FutureWaitPool scale-up wait window (ms). | |
Central feature-gate header for ThreadMan's optional integrations and tunable defaults.
Optional integration gates resolve to 1 (enabled) or 0 (disabled). A macro predefined by the build system (CMake) or the consumer always wins; otherwise it is auto-detected via __has_include.
Supported gates:
THREADMAN_WITH_NLOHMANN_JSON — JSON serialization hooks.THREADMAN_WITH_PARCEL — parcel cell adapters.Tunable defaults — every constant below can be redefined by the consumer before including <threadman/threadman.hpp> or overridden per-pool via ThreadPoolOptions. The defaults here are conservative and aim at general workloads.
| #define THREADMAN_DEFAULT_FUTURE_WAIT_SCALE_UP_WAIT_MS 10 |
FutureWaitPool scale-up wait window (ms).
Shorter than a CPU pool's: a worker blocked on std::future::get() is not doing useful work, so the wait pool adds capacity eagerly once it saturates.
| #define THREADMAN_DEFAULT_IDLE_TIMEOUT_MS 30000 |
Idle-timeout window: a non-core worker that sees no work for this long retires (milliseconds).
| #define THREADMAN_DEFAULT_POOL_NAME "tm::default" |
Name used by ThreadManager::default_pool().
| #define THREADMAN_DEFAULT_SCALE_CHECK_INTERVAL_MS 100 |
Housekeeper tick interval / per-pool scale evaluation cadence (ms).
| #define THREADMAN_DEFAULT_SCALE_UP_QUEUE_THRESHOLD 4 |
Queue-depth threshold above which the housekeeper considers scaling up.
| #define THREADMAN_DEFAULT_SCALE_UP_WAIT_MS 50 |
How long the oldest queued task is allowed to wait before forcing a scale-up (milliseconds).
| #define THREADMAN_DEFAULT_STUCK_TASK_THRESHOLD_MS 60000 |
A task that has been Running longer than this is flagged as stuck (ms).
| #define THREADMAN_DEFAULT_SUMMARY_INTERVAL_MS 1000 |
Periodic ManagerSummary cadence — listener publish interval (ms).
| #define THREADMAN_PLATFORM_APPLE 0 |
| #define THREADMAN_PLATFORM_LINUX 0 |
| #define THREADMAN_PLATFORM_OTHER 1 |
| #define THREADMAN_RECENT_TASKS_CAPACITY 256 |
Per-pool recent-task ring-buffer capacity.
The pool keeps a window of the most-recently-completed TaskHandles for snapshot_recent_tasks().
| #define THREADMAN_WITH_NLOHMANN_JSON 0 |
| #define THREADMAN_WITH_PARCEL 0 |