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

API reference / Memory

IReadSequentialMemory interface

The consumer side of a sequential memory.

Use
import ThinkMeta.ConcurrentTasks.Memory.SequentialMemory;
Namespace
ThinkMeta::ConcurrentTasks::Memory

Syntax

Remarks

The stream is read front to back in blocks. Protocol: for each block RequestReadMemory, use the bytes, ReleaseReadMemory. Several blocks may be requested before the first is released; a block stays valid until it is released. A single consumer. An implementation may suspend the calling task to wait for data, so call the members from a task.

See also

IWriteSequentialMemory, SpscVirtualMemoryPipe

Methods

GetSize

Returns the stream's total size in bytes.

Syntax

virtual std::size_t GetSize() const noexcept = 0;

Return value

Type: std::size_t

The total size announced by the producer, in bytes.

Remarks

May wait until the producer has announced it (IWriteSequentialMemory::Initialize).

RequestReadMemory

Returns the next block of the stream.

Syntax

virtual const std::byte* RequestReadMemory(std::size_t& size) noexcept = 0;

Parameters

sizestd::size_t&
On entry the wanted number of bytes; on return the number actually handed out, which is smaller only at the end of the stream.

Return value

Type: const std::byte*

The block, or nullptr with size 0 once the stream is exhausted.

See also

ReleaseReadMemory

ReleaseReadMemory

Gives back consumed bytes.

Syntax

virtual void ReleaseReadMemory(std::size_t size) noexcept = 0;

Parameters

sizestd::size_t
The oldest bytes handed out by RequestReadMemory; 0 is allowed.

Remarks

The memory may then be reused or freed.

Generated from ThinkMeta.ConcurrentTasks.API @ 137ec1d (2026-10-17).