SyncGen: An Aspect-Oriented Framework for Synchronization Xianghua Deng, Matthew Dwyer, John Hatcliff, and Masaaki Mizuno Department of Computing and Information Sciences Manhattan, KS 66506, USA {deng,dwyer,hatcliff,masaaki}@cis.ksu.edu Abstract. This paper describes SyncGen – a tool for automatically synthesizing complex synchronization implementations from formal high-level specifications. In SyncGen, synchronization specifications are phrased using first-order logic or user-friendly specification patterns. From a high-level specification, a language independent synchronization solution in an intermediate guarded-command lan- guage is synthesized. Back-end translators can translate this intermediate solution into a variety of implementation frameworks including Java, C++/C with POSIX threads, and Controller Area Network message passing primitives. SyncGen has been used extensively in courses at Kansas State University. Its breadth of appli- cability has been demonstrated by using it to solve virtually all of the exercises given in the well-known concurrency text books of Andrews[1,2] and Hartley[4], as well as a variety of real-world problems in the embedded computing domain. The tool, along with supporting documentation and an example repository, is pub- licly available [6]. Concurrency is a fundamental tool for meeting the ever increasing performance demands placed on software. With improved performance, however, comes the risk of unintended interference between software components executing in parallel. Developing robust syn- chronization policies and implementations that assure correct component collaboration without unduly restricting parallelism is a significant challenge. Inspired by Andrews’ global invariant approach to synchronization generation [1], we have developed Sync- Gen to allow application developers to synthesize customized synchronization solutions without having to concern themselves with the low-level details of their implementation. SyncGen separates the synchronzation and functional implementation of an application and provides aspect-oriented support for weaving them into a complete system. Using SyncGen, users develop sequential application code and identify regions of the appli- cation that are inter-dependent. The boundaries of those regions form the (cut) points at which synchronization policies must be enforced. Users can give a high-level formal specification of the synchronization policy which governs the collaborative execution of a group of code regions and SyncGen automatically synthesizes efficient synchroniza- tion aspect code and weaves that synchronization code into the core functional code at the appropriate region boundaries. The toolset is: – Useful – the tool has been used in advanced operating systems courses extensively at Kansas State University, and students and instructors find it tremendously useful. K. Jensen and A. Podelski (Eds.): TACAS 2004, LNCS 2988, pp. 158–162, 2004. c Springer-Verlag Berlin Heidelberg 2004