FlexSync: An aspect-oriented approach to Java synchronization
Abstract
Designers of concurrent programs are faced with many choices of synchronization mechanisms, among which clear functional trade-offs exist. Making synchronization customizable is highly desirable as different deployment scenarios of the same program often prioritize synchronization choices differently. Unfortunately, such customizations cannot be accomplished in the conventional non-modular implementation of synchronization. To enable customizability, we present FlexSync, an aspect oriented synchronization library, to enable the modular reasoning and the declarative specification of synchronization. Complex Java systems can simultaneously work with multiple synchronization mechanisms without any code changes. The FlexSync load-time weaver performs deployment time optimizations and ensures these synchronization mechanisms consistently interact with each other and with the core system. We evaluated FlexSync on commercially used complex Java systems and observed significant speedups as a result of the deployment-specific customization.