告诉线程以编程方式更改它正在处理的核心的方法是什么?
假设我正在使用具有一些内核的 FX-8150,但我希望我的一个线程能够在特别是 5.core 中工作。这可能吗?如果是的话,你能给一个Java的样本吗?该线程可能是另一个进程的线程或当前进程的线程。
我的伪示例:
time interval 1 : my_thread working in first core at 5GHz while other cores are 3.6 GHz
time interval 2 : my_thread working in second core at 5GHz while other cores are 3.6 GHz
time interval 3 : my_thread working in third core at 5GHz while other cores are 3.6 GHz
time interval 4 : my_thread working in fourth core at 5GHz while other cores are 3.6 GHz
time interval 5 : my_thread working in fifth core at 5GHz while other cores are 3.6 GHz
time interval 6 : my_thread working in sixth core at 5GHz while other cores are 3.6 GHz
time interval 7 : my_thread working in seventh core at 5GHz while other cores are 3.6 GHz
time interval 8 : my_thread working in eighth core at 5GHz while other cores are 3.6 GHz
所有其他核心都需要处于空闲状态。