{"title":"Atomic invariants verification and deadlock detection at compile-time","authors":"Ionut Tamas, I. Salomie, Marcel Antal","doi":"10.1109/ICCP.2018.8516602","DOIUrl":null,"url":null,"abstract":"Modern systems must take full advantage of the underlying hardware paradigms in order to yield higher throughput and lower latency. A common way of maximizing the hardware usage in a system is by leveraging multithreaded techniques. These techniques however are very hard to reason by and can yield hard to detect bugs, such as deadlocks, livelocks or race conditions from unwanted interleavings of threads in the system's execution. Atomic locks are a standard mechanism to provide a safe way to alleviate such issues by specifying what regions of code need to be executed atomically such that regardless of the threads interleavings the shared memory remains in a consistent state and makes the code execution as a simple serial execution that easy to analyze and reason by, yielding increased programmer productivity and system efficiency. Our paper proposes a system that allows user to easily verify if a C# codebase has correctly implemented the way shared memory (field or properties) are modified and is able to detect race conditions or deadlocks for the specified shared memory. The main goal is to improve developer productivity and to improve the system codebase by specifying the atomicity constraints as unit or integration tests. We present the overall architecture of the system and how it detects the way certain atomic invariants are checked and deadlocks are identified, as well as the integration with an existing codebase. We also describe how the system proves correctness in checking these invariants. We have verified our system against multithreaded C# codebases and the system successfully checks the atomicity invariants and deadlock cases outputting the correct scenarios of how these can happen. We have also provided a way to decrease the risk of concurrency bugs regressions and improving the code quality, thus proving that our system achieves the proposed goals of providing a way for increased developer productivity, correct detection of deadlocks, atomic invariants checking and concurrency bugs mitigation.","PeriodicalId":259007,"journal":{"name":"2018 IEEE 14th International Conference on Intelligent Computer Communication and Processing (ICCP)","volume":" 6","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2018-09-01","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"2018 IEEE 14th International Conference on Intelligent Computer Communication and Processing (ICCP)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICCP.2018.8516602","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0
Abstract
Modern systems must take full advantage of the underlying hardware paradigms in order to yield higher throughput and lower latency. A common way of maximizing the hardware usage in a system is by leveraging multithreaded techniques. These techniques however are very hard to reason by and can yield hard to detect bugs, such as deadlocks, livelocks or race conditions from unwanted interleavings of threads in the system's execution. Atomic locks are a standard mechanism to provide a safe way to alleviate such issues by specifying what regions of code need to be executed atomically such that regardless of the threads interleavings the shared memory remains in a consistent state and makes the code execution as a simple serial execution that easy to analyze and reason by, yielding increased programmer productivity and system efficiency. Our paper proposes a system that allows user to easily verify if a C# codebase has correctly implemented the way shared memory (field or properties) are modified and is able to detect race conditions or deadlocks for the specified shared memory. The main goal is to improve developer productivity and to improve the system codebase by specifying the atomicity constraints as unit or integration tests. We present the overall architecture of the system and how it detects the way certain atomic invariants are checked and deadlocks are identified, as well as the integration with an existing codebase. We also describe how the system proves correctness in checking these invariants. We have verified our system against multithreaded C# codebases and the system successfully checks the atomicity invariants and deadlock cases outputting the correct scenarios of how these can happen. We have also provided a way to decrease the risk of concurrency bugs regressions and improving the code quality, thus proving that our system achieves the proposed goals of providing a way for increased developer productivity, correct detection of deadlocks, atomic invariants checking and concurrency bugs mitigation.