Summary: | One of the latest concurrent programming technologies is Software Transactional Memory (STM). This degree project studied the use of STM by taking the large open-source computer game Globulation2 and modifying it from a non-concurrent version to several concurrent versions – a lock-based version and a STM version with finer granularity, as well as an additional STM version with coarser granularity. The different game versions were to be compiled with a STM compiler, which resulted in an evaluation of existing STM compilers. The first choice LLVM and Tanger turned out to be unable to compile the game versions because Tanger lacked an irrevocable mode and support for exceptions inside transactions as well as basic C++ support needed by the game, including memory operators new and delete and the C++ STL. Together with an instability that was detected while using the LLVM compiler and Tanger, LLVM and Tanger were finally considered too unstable to use as the STM compiler for this project. Instead the Intel C++ STM compiler was chosen as the STM compiler for the project, and could successfully be used to compile the different game versions. Performance data from the game versions was gathered by timing different parts of the code, including the simulation part of the game’s main loop where most of the game computation is done. Using the collected data a comparison of the game versions’ performance and how well they scaled when increasing the number of threads was made. The results showed that the STM versions of the game performed worse than the lock-based version and did not scale well when the number of threads was increased. The coarser-grained STM version did however have better performance and scaled better than the finer-grained STM version. Switches to irrevocable mode, transaction overhead and to some extent transaction retries were identified as possible reasons for the bad performance and scaling of the STM version. An attempt was also made to use an experimental version of the Intel C++ STM compiler that integrated the SwissTM STM library, but it was not ready to use, and SwissTM could not be used or evaluated in this project.
|