Software Transactional Memory in a Dynamic Programming Language at Virtual Machine Level

碩士 === 國立中正大學 === 資訊工程研究所 === 102 === As computer hardware evolves, the importance of parallel programming paradigm increases. As more and more multi-core processors emerge, traditional sequential programming paradigm no longer suffices. Yet only few modern dynamic programming languages can leverage...

Full description

Bibliographic Details
Main Authors: HSU, SZU-KAI, 許斯凱
Other Authors: LIN, PO-CHING
Format: Others
Language:en_US
Published: 2014
Online Access:http://ndltd.ncl.edu.tw/handle/49813811049358903093
Description
Summary:碩士 === 國立中正大學 === 資訊工程研究所 === 102 === As computer hardware evolves, the importance of parallel programming paradigm increases. As more and more multi-core processors emerge, traditional sequential programming paradigm no longer suffices. Yet only few modern dynamic programming languages can leverage such advantage. Ruby, for example, despite its wide adoption, only includes threads as a simple parallel primitive. The global virtual machine lock of official Ruby runtime makes it impossible to exploit full parallelism. Though various alternative Ruby implementations do eliminate the global virtual machine lock, they only provide developers dated locking mechanism for data synchronization. However, traditional locking mechanism error-prone by nature. Software Transactional Memory is one of the promising alternatives among others. It applies the concept of database transaction to memory manipulations, which ensures atomicity, consistency, isolation, and durability. The abstraction of transactions also avoids some common synchronization errors in the context of locking mechanism. This paper introduces a new virtual machine: GobiesVM to provide a native software transactional memory based solution for dynamic programming languages to exploit parallelism. We also proposed a simplified variation of Transactional Locking II algorithm. Our version combines the original read-set and the write-set into a single object set which makes the algorithm more comprehensive and reduces overhead regarding multiple set maintenance. The empirical results of our experiments show that support of STM at virtual machine level enables developers to write straightforward code without compromising parallelism or sacrificing thread safety. Existing source code only requires minimal or even none modification, which allows developers to easily switch their legacy codebase to a parallel environment. The performance evaluations of GobiesVM also indicate the difference between sequential and parallel execution is significant.