Name: shared-block-ring
Owner: MirageOS
Description: A simple on-disk fixed length queue
Created: 2013-12-02 13:43:40.0
Updated: 2016-11-04 22:09:14.0
Pushed: 2017-06-17 23:11:28.0
Homepage: null
Size: 288
Language: OCaml
GitHub Committers
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
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.
First create a “block device”– any file will do:
f=/dev/zero of=test.raw bs=10240 count=1
Then initialise the ring in the file:
in.native create
Then start two shells, in one run:
in.native produce
and in the other
in.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.