得意犹堪夸世俗,诏黄新湿字如鸦。这篇文章主要讲述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】
推荐阅读
- windows server 2012 r2 App-V 5.1 安装部署
- Android 目前最稳定和高效的UI适配方案
- Apple Tree POJ - 3321 dfs序列构造树状数组(好题)
- 华为终端开放实验室Android P Beta 4测试能力上线
- Android 使用Picasso加载网络图片等比例缩放
- APP测试功能点
- Android JNI基础篇
- AndroidStudio安装教程
- Android反编译apk并重新打包签名(Mac环境)