---
title: HTL_get_pool_for_thread_from_numa_pools
description: "获取randws_numa中的线程池。"
url: https://www.hikunpeng.com/document/detail/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0147.html
sourcePath: /source/zh/kunpengboostkithistory/2300/accel/kunpengaccel_ksl_16_0147.html
indexId: ea99984671efe666d071abb486019f0b670961679cc6ff9d1132a8c7404f3d3e74
---
# HTL_get_pool_for_thread_from_numa_pools

获取randws_numa中的线程池。

#### 接口定义

HTL_thread_pool_t HTL_get_pool_for_thread_from_numa_pools(int index);


#### 描述

HTL_get_pool_for_thread_from_numa_pools()用于根据指定索引index从randws_numa中获取对应线程池的句柄。


#### 参数

| 参数名 | 类型 | 描述 | 输入/输出 |
| --- | --- | --- | --- |
| index | int | 索引号。 | 输入 |


#### 返回值

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


#### 示例

```
ret = HTL_create_randws_numa_resource(num_executors);
main_threads = (HTL_thread_t *)malloc(num_executors * sizeof(HTL_thread_t));
/* Create pthread */
for (i = 0; i < num_executors; i++) {
HTL_thread_pool_t pool = HTL_get_pool_for_thread_from_numa_pools(i);
ret = HLT_thread_create_from_pool(pool, &main_threads[i],
NULL, create_threads, NULL);
}
```
