Home > Published Issues > 2023 > Volume 18, No. 5, May 2023 >
JCM 2023 Vol.18(5): 333-339
Doi: 10.12720/jcm.18.5.333-339

Managing Concurrent Queues for Efficient In- Vehicle Gateways

Miltos D. Grammatikakis, Stelios Ninidakis, George Kornaros, Dimitris Bakoyiannis, Nikos Mouzakitis, and Alexis Staridas
Electrical and Computer Engineering, Hellenic Mediterranean University, Heraklion, Greece

Manuscript received August 15, 2022; revised September 20, 2022; accepted October 30, 2022.

Abstract—In modern vehicles, electrical control units communicate over multiple in-vehicle networks via domainor zone-oriented gateway architectures. This work examines efficient frame transfer across incoming and outgoing Controller Area Network (CAN) interfaces at a gateway. In our embedded platform prototype, each CAN interface of a CAN-to-CAN gateway is controlled independently by a corresponding Portable Operating System Interface (POSIX) thread. Inter-thread communication and synchronization are implemented using shared data structures, either lock-free concurrent queues or traditional lock-based circular queues that embody single-producer single-consumer (SPSC) principles. Our experimental framework provides a realistic open automotive platform that integrates multiple CAN interfaces. An Odroid XU3 device acts as a gateway, providing two Universal Asynchronous Receiver- Transmitter (UART) to CAN interfaces that lead to Raspberry Pi 3B nodes (connected to CAN via Serial Peripheral Interface (SPI)). To increase communication reliability and performance by minimizing frame loss and improving the egress CAN frame rate, low-level parameters at the gateway are optimized, especially the inter-character delay of the UART-to-CAN interfaces. Our experiments show that the frame waiting time in the queue is shorter for the concurrent queue, while relaying messages is equally fast, reaching a maximum output rate of ~380 frames/s for large enqueue rates near saturation. Power consumption is almost four times higher for the concurrent queue implementation.

Keywords—automotive gateway, CAN bus, concurrent queue, frame rate, in-vehicle network, producer-consumer, reliability

Cite: Miltos D. Grammatikakis, Stelios Ninidakis, George Kornaros, Dimitris Bakoyiannis, Nikos Mouzakitis,
and Alexis Staridas, "Managing Concurrent Queues for Efficient In-Vehicle Gateways," Journal of Communications vol. 18, no. 5, pp. 333-339, May 2023. Doi: 10.12720/jcm.18.5.333-339

Copyright © 2023 by the authors. This is an open access article distributed under the Creative Commons Attribution License (CC BY-NC-ND 4.0), which permits use, distribution and reproduction in any medium, provided that the article is properly cited, the use is non-commercial and no modifications or adaptations are made.