STM (Software Transactional Memory) C++ state of the art

658 views Asked by At

I have a question about state of the art of the STM ( Software Transactional Memory ) in C++. I read on cppreference site (transactional_memory) that this is an experimental feature, but it also say that the page is under costruction, so my question is:

Is this feature now supported by the standard? (example c++17 or c++20)

If not yet, the cppreference page says:

This technical specification is supported by GCC as of version 6.1 (requires -fgnu-tm to enable). An older variant of this specification was supported in GCC as of 4.7.

Is this feature supported also by newer GCC versions?

1

There are 1 answers

0
Thomas On

The phrases "STM", "software" and "transactional" do not occur in the standard (working draft, N4849, 2020-01-14). So I think it's safe to say that it's not supported by the standard.

As for GCC, man g++ for version 10.2.0 says:

-fgnu-tm

When the option -fgnu-tm is specified, the compiler generates code for the Linux variant of Intel's current Transactional Memory ABI specification document (Revision 1.1, May 6 2009). This is an experimental feature whose interface may change in future versions of GCC, as the official specification changes. Please note that not all architectures are supported for this feature.

For more information on GCC's support for transactional memory,

Note that the transactional memory feature is not supported with non-call exceptions (-fnon-call-exceptions).

The second paragraph really ends mid-sentence. Maybe they meant to link to the GCC wiki page on TransactionalMemory.

In any case, it seems like support in GCC has been present in some form or other since version 4.7.