ThinkMeta ConcurrentTasks
ThinkMeta ConcurrentTasks is a task scheduler for Windows that runs tasks on fibers. A task can wait — for another task, an event, a lock, a file read or a socket — without blocking its OS thread: the thread simply runs the next task. A handful of threads keep all cores busy while thousands of tasks wait.
What you get
- A small core — the scheduler, timers and an I/O completion port, behind a C interface in a single header (Core.h).
- A C++ module library on top of it — tasks, synchronization primitives that suspend tasks instead of threads, lock-free collections, zero-copy pipes and asynchronous files and sockets.
- Plain code that waits. A task calls
Wait()in the middle of its work, in any function on its call stack — no callbacks, noco_awaitthrough every layer.
A first look
// The main thread becomes a task too, so it can wait without blocking a
// scheduler thread.
TC::ConvertThreadToTask();
// One scheduler thread per logical processor (numberOfThreads = 0).
TC::SchedulerInfo info{};
TC::ITaskScheduler* scheduler
= TC::CreateTaskScheduler(TC::SchedulerKind::Default, &info);
if (scheduler == nullptr)
return 1;
scheduler->Start();
HelloTask task; // must outlive the task: from AddTask until it has exited
scheduler->AddTask(&task);
task.Wait(); // suspends main until Run has returned
scheduler->Stop(); // only after every task has finished
scheduler->Destroy();
TC::ConvertTaskToThread();
return 0;The whole program is on Your first program.
Performance first
The core and the library are built for speed, not to be watertight against misuse: lifetimes, queue capacities and single-waiter rules are the developer's responsibility. Read Performance first before you build on it.
Where to go next
| If you want to … | Read |
|---|---|
| understand what it is and when it pays off | What is ConcurrentTasks?, When to use it |
| build and run something | Getting started |
| know how it works | Concepts |
| solve a concrete problem | Guides and Samples |
| look up a type or function | API reference |