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

API reference / Collections

ConcurrentStack alias

A lock-free intrusive LIFO stack.

Use
import ThinkMeta.ConcurrentTasks.Collections.ConcurrentStack;
Namespace
ThinkMeta::ConcurrentTasks::Collections
Platforms
Windows, Linux

Syntax

template <typename T> using ConcurrentStack = Detail::LockFreeStack<T>;

Template parameters

Ttypename
The item type; derives from ListEntry, through which items are linked.

Remarks

Push and Pop may be called from any number of threads and tasks at once. Items are linked through their ListEntry base, so pushing never allocates. The stack does not own its items; an item must stay alive while it is on the stack, and readable while a Pop that may have seen it there is still running. Destroying a non-empty stack just forgets the items. Flush removes all items in one operation and returns them as a chain through ListEntry::next: the stack is empty afterwards and is not touched by walking the chain, so a caller that must not access the stack after a certain point (the object may go away) takes the chain first and works through it afterwards. Read an item's next before handing the item to anybody else. Size is a snapshot, modulo 65536. The stack is the library's own on every platform; built with CT_CONCURRENT_STACK_SLIST on Windows, it is the system's interlocked SList instead (the two were measured alike).

See also

BasicStack

Generated from ThinkMeta.ConcurrentTasks.API @ c7663c4 (2026-11-19).