线程绑定到指定CPU

参考:https://mp.weixin.qq.com/s/494wqyxyFzDuGwG_51tFbQ

        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>affinity</artifactId>
            <version>3.20.0</version>
        </dependency>
    public static void main(String[] args) {

        try (AffinityLock affinityLock = AffinityLock.acquireLock(3)) {
            // do some work while locked to a CPU.
            while (true) {
            }
        }

    }

线程绑定到指定CPU

上一篇:ES5新增 数组操作forEach()、map()、filter()、some()、every()


下一篇:微信小程序学习(2)- 逻辑层