FineLock: automatically refactoring coarse-grained locks into fine-grained locks

Y. Zhang, Shuai Shao, Juan Zhai, Shiqing Ma
{"title":"FineLock: automatically refactoring coarse-grained locks into fine-grained locks","authors":"Y. Zhang, Shuai Shao, Juan Zhai, Shiqing Ma","doi":"10.1145/3395363.3404368","DOIUrl":null,"url":null,"abstract":"Lock is a frequently-used synchronization mechanism to enforce exclusive access to a shared resource. However, lock-based concurrent programs are susceptible to lock contention, which leads to low performance and poor scalability. Furthermore, inappropriate granularity of a lock makes lock contention even worse. Compared to coarse-grained lock, fine-grained lock can mitigate lock contention but difficult to use. Converting coarse-grained lock into fine-grained lock manually is not only error-prone and tedious, but also requires a lot of expertise. In this paper, we propose to leverage program analysis techniques and pushdown automaton to automatically covert coarse-grained locks into fine-grained locks to reduce lock contention. We developed a prototype FineLock and evaluates it on 5 projects. The evaluation results demonstrate FineLock can refactor 1,546 locks in an average of 27.6 seconds, including converting 129 coarse-grained locks into fine-grained locks and 1,417 coarse-grained locks into read/write locks. By automatically providing potential refactoring recommendations, our tool saves a lot of efforts for developers.","PeriodicalId":416261,"journal":{"name":"Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis","volume":"117 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2020-07-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"6","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 29th ACM SIGSOFT International Symposium on Software Testing and Analysis","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/3395363.3404368","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 6

Abstract

Lock is a frequently-used synchronization mechanism to enforce exclusive access to a shared resource. However, lock-based concurrent programs are susceptible to lock contention, which leads to low performance and poor scalability. Furthermore, inappropriate granularity of a lock makes lock contention even worse. Compared to coarse-grained lock, fine-grained lock can mitigate lock contention but difficult to use. Converting coarse-grained lock into fine-grained lock manually is not only error-prone and tedious, but also requires a lot of expertise. In this paper, we propose to leverage program analysis techniques and pushdown automaton to automatically covert coarse-grained locks into fine-grained locks to reduce lock contention. We developed a prototype FineLock and evaluates it on 5 projects. The evaluation results demonstrate FineLock can refactor 1,546 locks in an average of 27.6 seconds, including converting 129 coarse-grained locks into fine-grained locks and 1,417 coarse-grained locks into read/write locks. By automatically providing potential refactoring recommendations, our tool saves a lot of efforts for developers.
FineLock:自动将粗粒度锁重构为细粒度锁
锁是一种常用的同步机制,用于强制对共享资源的独占访问。但是,基于锁的并发程序容易发生锁争用,从而导致性能低下和可伸缩性差。此外,不适当的锁粒度会使锁争用变得更糟。与粗粒度锁相比,细粒度锁可以缓解锁争用,但使用困难。手动将粗粒度锁转换为细粒度锁不仅容易出错且繁琐,而且需要大量专业知识。在本文中,我们建议利用程序分析技术和下推自动机将粗粒度锁自动转换为细粒度锁,以减少锁争用。我们开发了FineLock原型,并在5个项目中对其进行了评估。评估结果表明,FineLock可以在平均27.6秒内重构1,546个锁,包括将129个粗粒度锁转换为细粒度锁,将1,417个粗粒度锁转换为读/写锁。通过自动提供潜在的重构建议,我们的工具为开发人员节省了大量工作。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
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学术官方微信
小红书