AutoSync Framework for Expressing Synchronization Intentions in Multithreaded Programs
摘要
To find concurrency bugs in multithreaded software and to be able to reconstruct synchronisation bottlenecks, it is necessary to understand concurrency-related aspects of such programs (shared variables, used synchronisation mechanisms, synchronisation intentions). However, static and dynamic analysis approaches (including the hybrid ones) either overapproximate their results, or are prone to missing some concurrency-related aspects. As a consequence, testers and software architects have to work in the dark when trying to choose tools for finding concurrency bugs and when trying to optimize multithreaded programs to take full advantage of parallel computing potential of multicore processors. To solve this problem, we suggest to divide the activities around synchronisations into two parts. In the first part, developers should only specify high-level intentions regarding access to shared variables. In the second part, it should be possible to automatically transfer these intentions to concrete programming-language specific synchronisation mechanisms. To enable this solution, we have developed the AutoSync framework that provides interfaces for specifying high-level synchronisation intentions and then automatically maps these to optimal synchronisation mechanisms (e.g., locks). AutoSync by design avoids concurrency bugs and is able to provide to architects information about program’s concurrency-related aspects so they can perform necessary optimisations.