Rate This Document
Findability
Accuracy
Completeness
Readability

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

    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);
    }