---
name: "PAPI_list_threads"
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_list_threads"
---

# PAPI\_list\_threads(3)

List the registered thread ids.

## NAME

PAPI\_list\_threads - List the registered thread ids.

## SYNOPSIS

## Detailed Description

**PAPI\_list\_threads()** returns to the caller a list of all thread IDs known to PAPI.

This call assumes an initialized PAPI library.

**C Interface**

\#include \<**papi.h**\> \
 int **PAPI\_list\_threads(PAPI\_thread\_id\_t \*tids, int \* number )**;

**Parameters**

*\*tids* -- A pointer to a preallocated array. This may be NULL to only return a count of threads. No more than \*number codes will be stored in the array. \
 *\*number* -- An input and output parameter. \
\
  Input specifies the number of allocated elements in \*tids (if non-NULL) and output specifies the number of threads.

**Return values**

*PAPI\_OK* The call returned successfully. \
 *PAPI\_EINVAL* \*number has an improper value

**See also**

**PAPI\_get\_thr\_specific**

**PAPI\_set\_thr\_specific**

**PAPI\_register\_thread**

**PAPI\_unregister\_thread**

**PAPI\_thread\_init** **PAPI\_thread\_id**

## Author

Generated automatically by Doxygen for PAPI from the source code.
