Conference paper

A C++ Shared-Memory Ring-Buffer Framework for Large-Scale Data Acquisition Systems

R. Ingles, M. Orlikowski, A. Napieralski (Lodz Univ. of Techn., Poland)

In a Large-Scale Data Acquisition System, each component must be capable to process the whole amount of data produced by the sources to ensure the highest level of accuracy and reliability, for that reason, the software processes responsible for gathering the raw data from the hardware devices and those for processing and distributing to specialized software sub-systems need to communicate as quickly as possible. From a software point of view, by using process concurrency a high usage level of the CPU processing power can be achieved, nevertheless, some synchronization mechanisms must be used to control when and how the processes access to data. Furthermore, the use of multithreading as a concurrency approach entails the issue that when one thread crashes, the whole process crashes. This paper presents the design of a C++ framework which implements a ring-buffer by using shared-memory as a fast mechanism of data communication among processes (fig. 1). Such solution has been designed based on the ITER CODAC framework [1]; those specifications set forth the design of a generic C++ framework to help to programmers with the developing of monitoring applications and control systems for the TOKAMAK device [2]. Likewise, the framework controls the access to data in the shared ring-buffer by implementing inter-process synchronization objects in shared-memory as well. In order to evaluate the effectiveness of the presented solution a series of tests has been performed, by comparing three different inter-process synchronization objects and two methods of gathering data. Such a comparison is based on the latency time measured from when a new data is written into the shared ring-buffer and the longest instant when such a data is gathered. The undertaken processes scheme consists of one producer and two consumers. The Figure 2 reflects the latency measurements for the shared ring-buffer which use atomic built-in functions. This approach reports the expected behavior for a message latency because the 94% of the messages were sent in two hundred nanoseconds or less. Furthermore, this behavior is constant for all configurations of slots in the ring-buffer evaluated. Nevertheless, the same approach but signaling by per-slot does not produce suitable results as is depicted in the Figure 3. As the results show, it is possible to develop a C++ framework for helping programmers to create data acquisition system when a large-scale data-stream is involved, getting suitable performance by using shared-memory and by encapsulating the inter-process communication operating system calls.

Download one page abstract

Receipt of papers:

March 15th, 2024

Notification of acceptance:

April 30th, 2024

Registration opening:

May 1st, 2024

Final paper versions:

May 15th, 2024