:1.214KB : :1 :2021-12-26 19:42:13
设置进程依附到某个cpu运行如果开发者对于本文件有需要的可以参考。
def searchPidAffinity(pname="SogouIEAutoTestServer.exe"): '''测试用的,用于打Log''' spid = get_PID_with_processname(pname) if spid != None: pid = int(spid) else: Log("亲~~没有该进程") return None cpuNum = get_process_affinity_mask(pid) import math if(cpuNum & (cpuNum - 1)) == 0: cNum = int(math.log(cpuNum, 2)) strCpu = "进程%s运行在%d号CPU上" % (pname, cNum) else: strCpu = "进程%s运行在所有CPU上" % pname return strCpu