---
name: "ck_pr_rtm"
section: "3"
platform: "linux"
package: "libck-dev"
version: "0.7.2-6"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/ck_pr_rtm"
---

# ck\_pr\_rtm(3)

restricted transactional memory

## NAME

**ck\_pr\_rtm\_begin**, **ck\_pr\_rtm\_end**, **ck\_pr\_rtm\_abort**, **ck\_pr\_rtm\_test** – restricted transactional memory

## LIBRARY

Concurrency Kit (libck, -lck)

## SYNOPSIS

**#include \<ck\_pr.h\>**

*unsigned* *int*\

**ck\_pr\_rtm\_begin**(*void*);

*void*\

**ck\_pr\_rtm\_end**(*void*);

*void*\

**ck\_pr\_rtm\_abort**(*const unsigned int status*);

*bool*\

**ck\_pr\_rtm\_test**(*void*);

## DESCRIPTION

These family of functions implement support for restricted transactional memory, if available on the underlying platform. Currently, support is only provided for Intel Haswell and newer x86 microarchitectures that have the TSX-NI feature.

The **ck\_pr\_rtm\_begin**() function returns CK\_PR\_RTM\_STARTED if a transaction was successfully started. In case of an abort, either internal (through a ck\_pr\_rtm\_abort) or external, program flow will return to the point which the function was called except the return value will consist of a bitmap with one or more of the following bits set:

- CK\_PR\_RTM\_EXPLICIT

  Set if the transactionally was explicitly aborted through **ck\_pr\_rtm\_abort**().

- CK\_PR\_RTM\_RETRY

  Set if the transaction failed but can still succeed if retried.

- CK\_PR\_RTM\_CONFLICT

  The transaction failed due to a conflict in one of the memory addresses that are part of the working set of the transaction.

- CK\_PR\_RTM\_CAPACITY

  Set if the architecture-defined transaction size limit was exceeded.

- CK\_PR\_RTM\_DEBUG

  Set if a hardware breakpoint was triggered.

- CK\_PR\_RTM\_NESTED

  Set if a nested transaction failed.

The user is also able to specify a one byte abort status by calling **ck\_pr\_rtm\_abort**(). This status byte can be extracted by calling the **CK\_PR\_RTM\_CODE**() function with the return value of **ck\_pr\_rtm\_begin**() as an argument. The return value of **CK\_PR\_RTM\_CODE**() will be the value of this status byte. For additional information, please see the Intel instruction set manuals.

## SEE ALSO

[ck\_pr\_fence\_load(3)](/ck_pr_fence_load/3.md), [ck\_pr\_fence\_load\_depends(3)](/ck_pr_fence_load_depends/3.md), [ck\_pr\_fence\_store(3)](/ck_pr_fence_store/3.md), [ck\_pr\_fence\_memory(3)](/ck_pr_fence_memory/3.md), [ck\_pr\_load(3)](/ck_pr_load/3.md), [ck\_pr\_store(3)](/ck_pr_store/3.md), [ck\_pr\_fas(3)](/ck_pr_fas/3.md), [ck\_pr\_faa(3)](/ck_pr_faa/3.md), [ck\_pr\_inc(3)](/ck_pr_inc/3.md), [ck\_pr\_dec(3)](/ck_pr_dec/3.md), [ck\_pr\_neg(3)](/ck_pr_neg/3.md), [ck\_pr\_not(3)](/ck_pr_not/3.md), [ck\_pr\_sub(3)](/ck_pr_sub/3.md), [ck\_pr\_and(3)](/ck_pr_and/3.md), [ck\_pr\_or(3)](/ck_pr_or/3.md), [ck\_pr\_xor(3)](/ck_pr_xor/3.md), [ck\_pr\_add(3)](/ck_pr_add/3.md), [ck\_pr\_btc(3)](/ck_pr_btc/3.md), [ck\_pr\_bts(3)](/ck_pr_bts/3.md), [ck\_pr\_btr(3)](/ck_pr_btr/3.md)

Additional information available at http://concurrencykit.org/
