打印

请问andoid 是否支持isolcpus将arm的某个核隔离?

[复制链接]
133|0
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
冰糖炖雪梨|  楼主 | 2018-9-8 17:06 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
请问andoid 是否支持isolcpus将arm的某个核隔离?
我想实现在arm的某个指定核上跑一个单独的线程,该核为该线程独占。
另外,在实现过程中,需要用cpu亲和性去绑定特定线程,发现android NDK不支持thread_setaffinity_np接口,请问哪位有解决办法?
dongshengcui@vizum-VirtualBox:~/qwz/bind$ aarch64-linux-android-g++ bindThread.c -o bindThread -lpthread
bindThread.c: In function \'void myfun(void)\':
bindThread.c:23:71: error: \'pthread_setaffinity_np\' was not declared in this scope
if (pthread_setaffinity_np(pthread_self(), sizeof(mask), &mask) < 0) {
^
bindThread.c:27:69: error: \'pthread_getaffinity_np\' was not declared in this scope
if (pthread_getaffinity_np(pthread_self(), sizeof(get), &get) < 0) {
^
dongshengcui@vizum-VirtualBox:~/qwz/bind$

使用特权

评论回复

相关帖子

发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

430

主题

436

帖子

0

粉丝