A Tag-Based Solution for Safer Parallel STL Usage

Benjámin Barth, Richárd Szalay, Z. Porkoláb
{"title":"A Tag-Based Solution for Safer Parallel STL Usage","authors":"Benjámin Barth, Richárd Szalay, Z. Porkoláb","doi":"10.2478/aei-2023-0008","DOIUrl":null,"url":null,"abstract":"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.","PeriodicalId":31657,"journal":{"name":"Acta Electrotechnica et Informatica","volume":"23 1","pages":"19 - 27"},"PeriodicalIF":0.0000,"publicationDate":"2023-06-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Acta Electrotechnica et Informatica","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.2478/aei-2023-0008","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

Abstract

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.
基于标签的更安全的并行STL使用解决方案
编程语言的不断发展不仅给编译器实现者带来了挑战,也给普通的开发人员带来了挑战。c++ 17标准引入了并行STL库,它是原始和基本的标准模板库(standard Template library, STL)的并行扩展,承诺以一种简单的方式实现安全、高效和可扩展的并行编程。虽然语法仍然很熟悉,但新的并行算法引入了额外的要求,即使是经验丰富的程序员也经常忽略这些要求。在本文中,我们调查了滥用并行STL的根本原因。我们进行了一个课堂实验来测量程序员在使用并行STL编程时的行为,发现主要问题不是他们的代码会出错,而是缺乏对并行函子的语义要求的认识。虽然对错误构造的全自动检测在计算上是不可实现的,但我们引入了一个框架,开发人员将能够根据绝对信任(axi公理)表明,操作具有算法所需的“安全”属性。我们实现了该框架的原型,以证明其可用性和有效性。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
审稿时长
8 weeks
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信