Java Packed Object synchronization

Thumbnail Image
Journal Title
Journal ISSN
Volume Title
University of New Brunswick
Concurrency and synchronization are fundamental issues critical for the design of applications that allow multiple threads to access the shared resources concurrently. The study of synchronization has grown in urgency with the proliferation of multi-core processors in recent years. In this thesis, we proposed thread-safe and efficient approaches to synchronization based on the packed object data model, which were introduced in IBM's J9 Virtual Machine as an experimental enhancement in order to help users gain greater control over the object layout. This object data model organizes data in a multi-tier manner (like the nested C structs), in which the object's data is nested in its enclosing PackedObject instead of being pointed to by an object reference as in the traditional Java object data model. The data overlapping between different tiers of PackedObject poses new challenges for synchronization, which is out of the scope of the traditional Java synchronization mechanisms. In order to address the new synchronization issues and situations raised by the packed object data model, we proposed a few different approaches to synchronization of multi-tier PackedObjects in multi-granularity locking. PackedSync is the first proposed approach for PackedObject synchronization that is based on a monitor without relying on the lock-word field. This approach gains better performance than the Java built-in synchronization approach in the coarse-grained locking. However it works only with two-tier PackedObjects and supports only the single-granularity locking. In order to address the multi-granularity locking on multi-tier PackedObjects, we proposed MultitierPackedSync based on an optimized concurrent linked-list that postpones the physical deletion of a node so as to reduce the overhead of unnecessary repetition of deletion and insertion operations. This approach improves the overall performance considerably comparing with PackedSync, the Java built-in synchronization and the Lazy MultitierPackedSync that is based on the lazy-list algorithm without our optimization. In order to further improve the performance of multi-tier data synchronization, we implemented a concurrent multiway tree in the left-child right-sibling tree representation that allows multiple threads to in parallel manipulate the tree structure. We then proposed a multi-granularity locking scheme (Tree-based MultitierSync) based on the concurrent multiway tree, which represents the containing and ordering relationship among the data in different tiers of PackedObjects. Comparing to the List-based MultitierSync (MultitierPackedSync), the Tree-based MultitierSync significantly improves the overall performance in different workloads, and the higher work load, the better performance gains can be achieved according to our benchmarks.