SchedulerInfo struct
Parameters of CreateTaskScheduler.
On this page
- Use
#include <ThinkMeta.ConcurrentTasks/Core.h>- Namespace
ThinkMeta::ConcurrentTasks- Platforms
- Windows, Linux
Syntax
struct SchedulerInfoRemarks
The core copies the struct.
Fields
version
ABI version the caller was built with.
Syntax
std::uint32_t version = SchedulerVersion;Remarks
Leave it at SchedulerVersion. CreateTaskScheduler rejects any other version.
numberOfThreads
Scheduler threads to run; 0 means one per logical processor.
Syntax
std::uint32_t numberOfThreads = 0;threadCallback
Called on every scheduler thread when it starts and when it exits.
Syntax
ThreadCallbackProc threadCallback = nullptr;See also
threadCallbackContext
Passed unchanged to threadCallback.
Syntax
void* threadCallbackContext = nullptr;Remarks
Must outlive the scheduler's threads.
taskSwitchPolicy
Switch policy of a SchedulerKind::TaskSwap scheduler.
Syntax
ITaskSwitchPolicy* taskSwitchPolicy = nullptr;Remarks
Required for TaskSwap, ignored otherwise.
See also
taskQueueCapacity
Capacity of each of the four task queues of a Default or a local scheduler.
Syntax
std::uint32_t taskQueueCapacity = 0;Remarks
It bounds the tasks that can be runnable at the same time per queue - new tasks per priority, and resumed or yielded tasks per priority - so choose it larger than the most tasks the application can have runnable at once; filling a queue is invalid use. Suspended tasks do not count. Rounded up to the next power of two; 0 means DefaultTaskQueueCapacity; above MaximumTaskQueueCapacity CreateTaskScheduler and CreateLocalScheduler fail. Each slot takes one cache line. Ignored by SchedulerKind::TaskSwap.
taskStackSize
Size of the stack of each task, in bytes.
Syntax
std::uint32_t taskStackSize = 0;Remarks
Address space reserved per task; memory is committed as the stack grows. 0 means the default: on Windows the stack reserve of the executable's header (1 MiB unless the linker was told otherwise), on Linux 1 MiB. Rounded up to the granularity of address space (64 KiB on Windows, the page size on Linux). Every task context the scheduler creates gets a stack of this size; a task's stack must hold its deepest call chain, as there is no way to grow it later. A SchedulerKind::Default, a SchedulerKind::TaskSwap and a local scheduler honour it; a dispatcher scheduler uses the default. Below each stack lies an inaccessible guard zone (Linux: 64 KiB, as clang probes large frames only with -fstack-clash-protection), so an overflow faults. On Linux a signal handler installed without SA_ONSTACK runs on the stack of the task it interrupts and needs room there; the core installs no alternate signal stack. Linux shadow stacks (CET, -fcf-protection) are not supported: the fiber switch carries no shadow-stack note, so glibc turns them off for the process or refuses it.
Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).