android cpu affinity

得意犹堪夸世俗,诏黄新湿字如鸦。这篇文章主要讲述android cpu affinity相关的知识,希望能为你提供帮助。
暂时无法获取当前线程运行在哪个CPU上,待调查...
 

int omask = 0; int nmask = 0xF0; static void affinity() { int err; int syscallres = syscall(__NR_sched_getaffinity, gettid(), sizeof(omask), & omask); if (syscallres) { err = errno; LOGE("Error in the syscall getaffinity: omask=%d=0x%x err=%d=0x%x", omask, omask, err, err); }LOGE("before-get affinity success, tid = %d , mask = ", gettid(), omask); syscallres = syscall(__NR_sched_setaffinity, gettid(), sizeof(nmask), & nmask); if (syscallres) { err = errno; LOGE("Error in the syscall setaffinity: nmask=%d=0x%x err=%d=0x%x", nmask, nmask, err, err); }syscallres = syscall(__NR_sched_getaffinity, gettid(), sizeof(omask), & omask); if (syscallres) { err = errno; LOGE("Error in the syscall getaffinity: omask=%d=0x%x err=%d=0x%x", omask, omask, err, err); }LOGE("after-get affinity success, tid = %d , mask = ", gettid(), omask); }

【android cpu affinity】

    推荐阅读