Skip to main content

Research Repository

Advanced Search

Building a C++CSP Channel Using C++ Atomics

Chalmers, Kevin


Kevin Chalmers


Mutex-based implementations of synchronous channels are slow. This work investigates atomic operations as a technique to improve communication efficiency between two threads via a busy channel. Such a channel provides faster communication than a mutex-based one where the number of threads is identical to the hardware con-currency. To evaluate communication performance, a communication time benchmark is used alongside a selection time benchmark. The communication time benchmark is scaled to evaluate the impact of thread counts greater than the available hardware. Results show that an above ten-times improvement in communication time is possible when the hardware supports the threads fully. The improvement drops as further threads are added to the system due to operating system scheduling taking over the determination of thread activeness. Selection time similarly shows improvement when thread count matches hardware, but likewise reduces as thread count increases. We can conclude that a busy channel is useful in an environment where the thread count matches the available hardware, which is of interest to parallel application developers or control systems with similar properties.


Chalmers, K. (2019). Building a C++CSP Channel Using C++ Atomics. .

Conference Name Communicating Process Architectures 2017
Conference Location Malta
Start Date Aug 20, 2017
Acceptance Date Jun 23, 2017
Online Publication Date Aug 20, 2017
Publication Date 2019
Deposit Date Aug 15, 2019
Publisher IOS Press
Series Title Concurrent Systems Engineering
Series Number 70
Series ISSN 1879-8039
ISBN 978-1-61499-948-5
Keywords concurrency; channel communication; atomic operations
Public URL