[
Index ] [ Bottom ]

Circ v5


Circular buffer application interface

The idea and the first implementation of the circular buffer comes from
Harry Beker. It allows high speed event buffering and passing between 
processes or threads using a simple reserve/validate and locate/release
mechanism. Event data can be prepared and processed in place and hence
avoiding unnecessary data copies.

Modification have been applied to improve error handling, POSIX and thread
support and documentation. Furthermore there are now also special functions
to ease parallel processing especially for event building.

The circular buffer supports the following interfaces for inter-process-
communication (IPC).

 1. SYSV shared memory and semaphore.
 2. POSIX (P1003.1b) shared memory and semaphore.
 3. POSIX threads and mutex function.

For the inter-thread version the POSIX mutex calls are used to make
atomic access to the circular buffer header instead of POSIX or SYSV
semaphores for the inter-process version.

The message system implemented inside KLOE DAQ uses interupts for
signaling new command arrival. This can interupt a semaphore allocation,
so the interupts are forced to be ignored during the SETSEMA operation.
To enable interupts, set CircSemIgnoreIntr to 0 at run-time.
(CircSemIgnoreIntr is 1 per default)

Have a look to the example and test programs:
   Circread.c   and 
   Circwrite.c  for inter-process
   Circthread.c for inter-threads.

Note: There are FORTRAN bindings as well (inter-process version only)!

[
Index ] [ Top ]
Created 10/12/98 08:24 by source2html v0.9