Proceedings of ISP RAS

Instrumentation and Optimization of Transactional Sections Execution in Multithreaded Programs.

I. Kulagin (SibSUTIS, Novosibirsk), M. Kurnosov (ETU, St. Petersburg)


Software transactional memory (STM) is approach to develop thread-safe programs. In contrast to locking a block of code by mutex, the main idea of this approach is to protect memory areas from concurrent access by threads. In this paper, we investigate efficiency of software transactional memory implementation in GCC compiler. Software tools for instrumentation and profiling STM-programs are proposed. Profile-guided method for reducing false conflicts. in STM-programs is presented. False conflict is conflict that exist on the level of runtime library but not when the memory accessing happens. The instrumentation module analyzes the code of transactional sections and puts calls for registration of the some events (begin transactions, transactional read/write, commit transactions and abort transactions). The profiling of the instrumented program allows get dynamic properties of execution transactional code like size of used data, read/write addresses, timestamp of events, etc. The static instrumentation allows to optimize dynamic properties of execution transactional sections. The method of reducing false conflicts performs the tuning of transactional memory parameters value in GCC implementation (libitm runtime-library) by using the profiling results (profile-guided optimization). The efficiency of reducing false conflicts is investigated on the STAMP benchmarks. These benchmarks contains eight tests that operate with hash tables, lists, arrays protected by software transactional memory. Using the proposed method of the tests time is reduced approximately to 20%.


software transactional memory; instrumentation; profile-guided optimization; multithreaded programming; compilers


Proceedings of the Institute for System Programming, vol. 27, issue 6, 2015, pp. 135-150.

ISSN 2220-6426 (Online), ISSN 2079-8156 (Print).

DOI: 10.15514/ISPRAS-2015-27(6)-9

Full text of the paper in pdf (in Russian) Back to the contents of the volume