Abstract:
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%.