/shared-block-ring

A simple on-disk fixed length queue

Primary LanguageOCamlISC LicenseISC

shared-block-ring

Build Status Coverage Status

A simple on-disk fixed length queue in the style of the Xen shared-memory-ring. In particular the producer and consumer APIs allow clients to control exactly when data is exposed to the consumer and removed from the queue.

Example usage

First create a "block device"-- any file will do:

dd if=/dev/zero of=test.raw bs=10240 count=1

Then initialise the ring in the file:

./main.native create

Then start two shells, in one run:

./main.native produce

and in the other

./main.native consume

The producer takes input from stdin and puts it onto the ring, and the consumer takes entries from the ring and prints them to stdout.