Micro-toolkit

micoring

Producer and consumer code need a bounded queue with explicit ownership.

A fixed-capacity copy-based ring uses caller-owned storage, with optional constrained SPSC atomic mode.

DevelopmentMITC99
Last verified
Not audited against current README/docs
Platform scope
Portable C99; integration depends on caller-provided adapters

What it solves

Producer and consumer code need a bounded queue with explicit ownership.

How it works

1Producer2copy into ring3consumer copy out

Use it when

Buffer fixed-size samples
Queue bytes between serialized tasks
Use one-producer/one-consumer atomic mode where supported

Quick Start

#include "mring.h"
static uint8_t storage[8*sizeof(sample_t)]; mring_t ring;
int rc=mring_init(&ring,storage,sizeof storage,8,sizeof(sample_t));
/* Expected: rc indicates a ready eight-element ring. */

Engineering evidence

  • CMake, Make and public contract documentation are present

Known limits

  • Default is single-context
  • Overwrite is unsupported in atomic mode
  • Snapshot queries need quiescence or synchronization in atomic mode