Abstract

Developers of parallel programming are faced with choices of using various Java locks. Choosing the best lock is a challenging task because a multithreaded application implemented using different locks may end up with uncertain performance. There is a strong need for automated tool support that helps Java programmers choose the best lock for each specific application. This paper presents an automated transformation approach to convert an implementation using a synchronized lock to a ReentrantLock or a ReentrantReadWriteLock at the bytecode level. For the ReentrantLock, our approach runs analysis for global monitors using the visitor pattern in the Joeq compiler. For the ReentrantReadWriteLock, a read or write lock is chosen after a side-effect analysis. Then, the proposed system validates the consistency of the analysis results to ensure a correct sequence of lock usage. Finally, lock operations and related thread communication operations are transformed into a ReentrantLock or a ReentrantReadWriteLock using a bytecode transformation framework Javassist. We validate our approach on several benchmarks including RBTree, PC, SPECjbb2005, and HSQLDB. The experimental results show that the proposed automated transformation approach can transform these benchmarks successfully in a timely fashion.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call