当前位置:网站首页>查询当前电脑cpu核心数
查询当前电脑cpu核心数
2022-06-13 11:20:00 【wwanxinghao】
背景:python真正的并发需要用到进程,每个进程需要用1个核心,所以需要知道当前电脑CPU核心数,并设置在多进程技术中
import psutil as ps
print(ps.cpu_count()) # 物理CPU个数:8
print(ps.cpu_count(logical=False)) # 逻辑CPU个数:4
多进程使用的是物理cpuh核数,有做了下面的实验,8个时间是一致的,但并不是每8个请求都一致是最多的时候有8个时间一致,其他时间可能是4个并发,7个并发这样
边栏推荐
- WinForm resolves frequent refresh of black screen
- Pagoda access changed from IP to domain name
- Determine the maximum match between bipartite graph and bipartite graph
- 2021CCPC网络赛榜单
- About SAP Spartacus cmsservice Possible optimization ideas for getcomponentdata
- [ROS] moveit rviz seven DOF Manipulator Simulation
- 【TcaplusDB知识库】TcaplusDB集群管理介绍
- 【ROS】MoveIt-rviz-七自由度机械臂仿真
- 音视频技术开发周刊 | 249
- Tamidog knowledge | a comprehensive analysis of the meaning and role of mergers and acquisitions of state-owned enterprises
猜你喜欢
[tcapulusdb knowledge base] Introduction to tmonitor background one click installation (II)
我是如何解决码云图床失效问题?
【TcaplusDB知识库】Tmonitor单机安装指引介绍(一)
状态压缩DP例题(旅行商问题和填矩形问题)
恶意代码实战分析Lab05-01
Based on vue+nest Js+mysql cross platform open source community operation management system
Pagoda add a website: PHP project
Interval modification multiplication and addition (a good example of understanding lazy tags)
宝塔中navicat连接mysql
Easyclick run code snippet out null
随机推荐
【TcaplusDB知识库】TcaplusDB集群管理介绍
[tcapulusdb knowledge base] tcapulusdb Model Management Introduction
统计特殊子序列数目(0,1,2)DP
第六章 I/O管理作业
Show/exec and close/hide of QT form are not executed when calling the close destructor
【sql语句基础】——查(select)(单表查询顺序补充)
Alibaba's employees decreased by 4000 in the first quarter; Programmers wrote scripts to hang up vaccine numbers and were arrested for making a profit of 400000 yuan; Sohu encounters epic email fraud,
【TcaplusDB知识库】TcaplusDB单据受理-创建业务介绍
Web3 系统构建:去中心化的原则、模型和方法(上)
[ROS] moveit rviz seven DOF Manipulator Simulation
21世纪以来的历次“粮食危机”,发生了什么?
【TcaplusDB知识库】TcaplusDB常规单据介绍
【TcaplusDB知识库】Tmonitor单机安装指引介绍(二)
[tcapulusdb knowledge base] Introduction to new models of tcapulusdb
Web3和NFT中的匿名性问题
《气候韧性和可持续性》| 新研究表明超级飓风未来几年会对南亚产生更大破坏
CommonAPI与AUTOSAR AP通讯管理的异同
模型搭建过程1==MIIDock
Mac 安装 MySQL 教程
MIIdock文件分布