Demo for HAL ringbuffer functions
---------------------------------

HAL ring buffers support non-blocking, variable-sized record queue
operations between HAL components. The underlying model is a
lock-free, single-reader, single-writer queue which does not require
any operating system support and is extremely fast.

In the linuxCNC context, HAL ringbuffers are intended to replace a
variety of special-purpose messaging schemes like the ones used
between task and motion, in halstreamer, halsampler and halscope, at
the same time making those amenable to a networked messaging
integration.

For an introduction on lock-free programming, see:

  http://preshing.com/20120612/an-introduction-to-lock-free-programming
  http://julien.benoist.name/lockfree.html

The definitive reference on the subject is:
  Herlihy/Shavit:  The Art of Multiprocessor Programming, Morgan Kaufmann 2012.

Original code by Pavel Shramov, 1/2013, http://psha.org.ru/cgit/psha/ring/ .
HAL integration by Michael Haberler, 2/2013.


Demo: messaging between RT components:
--------------------------------------
 $ halrun -I ring-demo.hal

and watch /var/log/linuxcnc.log


Demo: sending messages from a Python program to an RT component:
--------------------------------------
 $ halrun -I recordread.hal
 $ python ringwrite.py  # second window

and watch /var/log/linuxcnc.log

Other demos - see various .py files.



For the ring C API, see hal/lib/hal_ring.h/.c.
