---
name: "PAPI_register_thread"
section: "3"
platform: "linux"
package: "libpapi-dev"
version: "7.1.0-5+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PAPI_register_thread"
---

# PAPI\_register\_thread(3)

Notify PAPI that a thread has 'appeared'.

## NAME

PAPI\_register\_thread - Notify PAPI that a thread has 'appeared'.

## SYNOPSIS

## Detailed Description

**C Interface:**

\#include \<**papi.h**\> \
 int **PAPI\_register\_thread** (void);

**PAPI\_register\_thread()** should be called when the user wants to force PAPI to initialize a thread that PAPI has not seen before.

Usually this is not necessary as PAPI implicitly detects the thread when an eventset is created or other thread local PAPI functions are called. However, it can be useful for debugging and performance enhancements in the run-time systems of performance tools.

**Return values**

*PAPI\_ENOMEM* Space could not be allocated to store the new thread information. \
 *PAPI\_ESYS* A system or C library call failed inside PAPI, see the errno variable. \
 *PAPI\_ECMP* Hardware counters for this thread could not be initialized.

**See also**

**PAPI\_unregister\_thread**

**PAPI\_thread\_id**

**PAPI\_thread\_init**

## Author

Generated automatically by Doxygen for PAPI from the source code.
