{"title":"Towards Safer Parallel STL Usage","authors":"Benjámin Barth, Richárd Szalay, Z. Porkoláb","doi":"10.1109/Informatics57926.2022.10083416","DOIUrl":null,"url":null,"abstract":"Effective and safe parallel programming is among the biggest challenges of today's software technology. The C++ 17 standard introduced Parallel STL: a set of overloaded functions taking an additional “execution policy” parameter in the Algorithms chapter of the Standard library. During the years since its introduction, a few shortages of Parallel STL have been revealed. While the Standard defines the semantics of the individual algorithms, adherence to their abstract requirements - e.g., absolutely no data races or deadlocks during the evaluation of a predicate or other customisation point - is up to the developer. Experience shows that programmers frequently make mistakes and write erroneous code, which is hard to debug. In this paper, we investigate some of the critical issues of the Parallel STL library and suggest improvements to increase its safety. While a fully automatic detection of erroneous constructs is computationally infeasible to do, we introduce a framework with which the user will be able to indicate - axiomatically, based on absolute trust - that an operation has “safe” properties, e.g., commutativity of certain functors. We implemented a prototype of the proposed framework to demonstrate its usability and effectiveness.","PeriodicalId":101488,"journal":{"name":"2022 IEEE 16th International Scientific Conference on Informatics (Informatics)","volume":"1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2022-11-23","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2022 IEEE 16th International Scientific Conference on Informatics (Informatics)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/Informatics57926.2022.10083416","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Effective and safe parallel programming is among the biggest challenges of today's software technology. The C++ 17 standard introduced Parallel STL: a set of overloaded functions taking an additional “execution policy” parameter in the Algorithms chapter of the Standard library. During the years since its introduction, a few shortages of Parallel STL have been revealed. While the Standard defines the semantics of the individual algorithms, adherence to their abstract requirements - e.g., absolutely no data races or deadlocks during the evaluation of a predicate or other customisation point - is up to the developer. Experience shows that programmers frequently make mistakes and write erroneous code, which is hard to debug. In this paper, we investigate some of the critical issues of the Parallel STL library and suggest improvements to increase its safety. While a fully automatic detection of erroneous constructs is computationally infeasible to do, we introduce a framework with which the user will be able to indicate - axiomatically, based on absolute trust - that an operation has “safe” properties, e.g., commutativity of certain functors. We implemented a prototype of the proposed framework to demonstrate its usability and effectiveness.