Skip to main content

IBM XL C/C++ for Transactional Memory for AIX

A complete programming environment for developing scalable parallel applications using software transactional memory (STM).

Date Posted: May 29, 2008

alphaworks tab navigation

 

What is IBM XL C/C++ for Transactional Memory for AIX?

IBM® XL C/C++ for Transactional Memory for AIX® provides a complete programming environment for developing scalable parallel applications using transactional memory. This programming environment includes the following:

In this environment, programmers use language directives to define units of concurrent computation, called transactions, which are executed atomically and in isolation. The compiler and the run-time system ensure the correct execution of concurrent transactions.

The environment also provides additional facilities to help users tune and debug transactional programs:

This alphaWorks® release is a functional release of the transactional memory compiler for AIX® POWER™/PowerPC® platforms. Because it is a functional release, the performance of the generated code will vary. Work continues on both functional and performance improvements for the compiler and the run-time environment.

How does it work?

In order to write a program using transactional memory language extension, users first write a multi-threaded program using, for example, OpenMP directives or thread Libraries, then mark critical sections using #pragma tm atomic. If transactions are invoked in critical sections, they can be annotated by the attributes of transactional memory function at function declaration. Following is an example:

int incre(int sum) __attribute__((tm_func)) ;

#pragma omp parallel for
for(int i=0; i <100; i++) {
   #pragma tm atomic
   {
     sum = incre(sum);
   }
}

The source code for the complete program foo.c can be found in the FAQ.

Steps for compiling and executing the source program foo.c are as follows:

% stmxlc –qsmp=omp foo.c -lstm
% setenv OMP_NUM_THREADS 4
% ./a.out

For further details on compiling and executing the program, please refer to the FAQ.

The following white paper contains key information for writing a transactional memory program using this compiler: Language extensions and user's guide.

About the technology author(s)

The development of the IBM XL C/C++ for Transactional Memory for AIX is a collaborative effort among researchers from the following IBM labs:

Trademarks




Related technologies