Skip to main content

Module thread_buffer

Module thread_buffer 

Source

Structs§

ThreadBuffer
Per-thread buffer containing an SPSC queue and thread metadata. Allocated on the heap via new_on_heap() (1MB+, too large for the stack).
ThreadBufferRegistry
Lock-free thread buffer registry.

Constants§

MAX_THREADS
Maximum number of concurrent writer threads supported. Log calls from threads exceeding this limit will panic. 1MB queue x 256 = 256MB memory ceiling, which is sufficient for most use cases.

Statics§

THREAD_BUFFER_REGISTRY
Global lock-free registry.

Functions§

alloc_message
Allocates space for a message in the current thread’s SPSC queue.
get_thread_buffer
Returns the current thread’s ThreadBuffer pointer, allocating one first if needed.
set_thread_name
Sets the logging thread name for the current thread.