目录
操作系统
获取CPU数量
设置亲和性
>>> import os >>> os.cpu_count()
# run on linux import os pid = os.getpid() affinity = {1} os.sched_setaffinity(pid, affinity)
该项目试图提供许多简化生活的 Python 代码片段。