Preliminary. ThinkMeta ConcurrentTasks and this documentation are preliminary; everything is subject to change.

API reference / Core

ILocalScheduler interface

A scheduler that runs its tasks inside Run, on the thread that calls it.

On this page
Use
#include <ThinkMeta.ConcurrentTasks/Core.h>
Namespace
ThinkMeta::ConcurrentTasks
Inherits
ITaskScheduler
Platforms
Windows, Linux

Syntax

Remarks

Created by CreateLocalScheduler. The scheduler has no threads: tasks added with AddTask wait until Run runs them, and Run returns once every task of the scheduler has ended. While all of them wait, the thread sleeps until one can go on. The thread that calls Run owns the scheduler: only it adds tasks, before Run or from the scheduler's tasks. Tasks may be resumed from any thread, also by timers and by the completion of asynchronous I/O, so they can wait for tasks of other schedulers. The order is that of the default scheduler: resumed before new tasks, high before normal priority, first in first out within each. Start and Stop do nothing. Destroy is called once no task is left and Run has returned.

See also

CreateLocalScheduler

Methods

Run

Runs the scheduler's tasks on the calling thread until none is left.

Syntax

virtual void Run() noexcept = 0;

Remarks

Blocks the calling thread until every task of the scheduler has ended, including tasks the tasks add and tasks added by time (AddTimedTask). While all of them wait, the thread sleeps. May be called again once it has returned. Only on a plain thread: not from a task of any scheduler and not on a converted thread (ConvertThreadToTask), and not twice at the same time. While Run runs, only its thread may add tasks (AddTask, AddTimedTask); that is, the scheduler's own tasks. The scheduler may be destroyed as soon as Run has returned.

Generated from ThinkMeta.ConcurrentTasks.API @ 8da5722 (2026-11-16).