Android set thread affinity

后端 未结 3 1388
余生分开走
余生分开走 2021-01-05 08:59

Following the answer from this StackOverflow question how do I create the proper integer for mask?

I made some googling and the everything I found uses CPU_SE

3条回答
  •  太阳男子
    2021-01-05 09:40

    I would like to pay your attention that function from link in the first post doesn't set the thread cpu affinity. It suits to set the process cpu affinity. Of course, if you have one thread in your application it works well but it is wrong for several threads. Check up sched_setaffinity() description for example on http://linux.die.net/man/2/sched_setaffinity

提交回复
热议问题