当前位置: 技术问答>linux和unix
如何查询到被绑定的CPU
来源: 互联网 发布时间:2017-04-09
本文导语: RT,怎么知道哪几个CPU是被绑定的 | NAME pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a thread SYNOPSIS #define _GNU_SOURCE /* See feature_test_macros...
RT,怎么知道哪几个CPU是被绑定的
|
NAME
pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a thread
SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include
int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
const cpu_set_t *cpuset);
int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize,
cpu_set_t *cpuset);
Compile and link with -pthread.
pthread_setaffinity_np, pthread_getaffinity_np - set/get CPU affinity of a thread
SYNOPSIS
#define _GNU_SOURCE /* See feature_test_macros(7) */
#include
int pthread_setaffinity_np(pthread_t thread, size_t cpusetsize,
const cpu_set_t *cpuset);
int pthread_getaffinity_np(pthread_t thread, size_t cpusetsize,
cpu_set_t *cpuset);
Compile and link with -pthread.