HTL_thread_executor_set_cpubind

将执行器绑定到目标CPU。

接口定义

int HTL_thread_executor_set_cpubind(HTL_thread_executor_t executor, int cpuid);

描述

HTL_thread_executor_set_cpubind()将执行器绑定到CPU ID上,CPU ID对应于处理器索引。

参数

参数名

类型

描述

输入/输出

executor

HTL_thread_executor_t

执行器句柄。

输入

cpuid

int

CPU ID。

输入

返回值

示例

1
2
    new_cpuid = (cpuid + 1) % num_executors;
    ret = HTL_thread_executor_set_cpubind(executor, new_cpuid);