---
title: HTL_thread_executor_get_num
description: "获取当前执行器的数量。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/240RC1/accel/kunpengaccel_ksl_16_0065.html
sourcePath: /source/zh/kunpengboostkithistory/240RC1/accel/kunpengaccel_ksl_16_0065.html
indexId: 86b84282276d41893fcfa7b1d2ac246028734201efb92c26ae09cbcde1205f7c76
---
# HTL_thread_executor_get_num

获取当前执行器的数量。

#### 接口定义

int HTL_thread_executor_get_num(int *num_executor);


#### 描述

HTL_thread_executor_get_num()通过num_executor返回HTL线程执行环境中存在的执行器数量。该函数会计算正在运行和终止的执行器。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| num\_executor | int \* | 执行器的数量。 | 输出 |


#### 返回值

- HTL_THREAD_SUCCESS：成功。
- 其他：失败。见错误码定义。


#### 示例

```
int num_executor = 0;
/* Get the number of executor */
ret = HTL_thread_executor_get_num(&num_executor);
```
