Have a personal or library account? Click to login
A Tag-Based Solution for Safer Parallel STL Usage Cover

A Tag-Based Solution for Safer Parallel STL Usage

Open Access
|Aug 2023

Abstract

The continuous evolution of programming languages creates a challenge not only for the compiler implementers but also for the regular developers. The C++17 standard introduced the Parallel STL library, a parallel extension of the original and fundamental Standard Template Library (STL) with the promise to achieve safe, efficient, and scalable parallel programming in an easy way. While the syntax remained familiar, the new parallel algorithms introduced additional requirements, which are often ignored even by experienced programmers. In this paper, we investigate the root cause of the misuse of the Parallel STL. We carried out a classroom experiment to measure the programmers’ behaviour when programming using the Parallel STL and found that the major issue is not that their code would be erroneous, but the lack of awareness of the semantic requirements of parallel functors. While a fully automatic detection of erroneous constructs is computationally infeasible to achieve, we introduce a framework with which the developer will be able to indicate – axiomatically, based on absolute trust – that an operation has “safe” properties required by the algorithms. We implemented a prototype of the proposed framework to demonstrate its usability and effectiveness.

DOI: https://doi.org/10.2478/aei-2023-0008 | Journal eISSN: 1338-3957 | Journal ISSN: 1335-8243
Language: English
Page range: 19 - 27
Submitted on: Apr 16, 2023
Accepted on: Jun 23, 2023
Published on: Aug 8, 2023
Published by: Technical University of Košice
In partnership with: Paradigm Publishing Services
Publication frequency: 4 issues per year

© 2023 Benjámin Barth, Richárd Szalay, Zoltán Porkoláb, published by Technical University of Košice
This work is licensed under the Creative Commons Attribution 4.0 License.