我要评分
获取效率
正确性
完整性
易理解

HTL_get_pool_for_thread_from_numa_pools

Obtains thread pools in randws_numa.

Interface Definition

HTL_thread_pool_t HTL_get_pool_for_thread_from_numa_pools(int index);

Description

HTL_get_pool_for_thread_from_numa_pools() is used to obtain the handle to a thread pool in randws_numa based on the specified index.

Parameters

Parameter

Type

Description

Input/Output

index

int

Index number.

Input

Return Value

  • HTL_THREAD_SUCCESS: success.
  • Other values: failure. For details, see the error code descriptions.

Example

1
2
3
4
5
6
7
8
9
    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 = HTL_thread_create_from_pool(pool, &main_threads[i],
                                NULL, create_threads, NULL);
    }