当前位置:网站首页>Problems caused by Gil problems and Solutions
Problems caused by Gil problems and Solutions
2022-06-25 08:27:00 【victorwjw】
python Because of its global interpreter lock GIL We can't achieve real parallel computing through threads . Need to be solved IO intensive and Computationally intensive The parallel operation problem of .
IO intensive : Read the file , Read network Socket frequent .
Computationally intensive : A lot of consumption CPU Mathematical and logical operations of , That is what we call parallel computation here .
IO intensive : The solution is synergy , frequently-used greenlet 、gevent、ayncio Wait to deal with
Simple understanding See connection below :
See you further Link below
Computationally intensive : Commonly used concurrent.futures Module to handle
concurrent.futures modular , You can use multiprocessing To achieve true parallel computing .
The core principle is :concurrent.futures In the form of subprocesses , Run multiple... In parallel python Interpreter , So that python Programs can take advantage of multicore CPU To speed up execution . Because subprocesses are separated from the main interpreter , So their global interpreter locks are also independent of each other . Each subprocess can use a complete CPU kernel .
python concurrent.futures_weixin_30394981 The blog of -CSDN Blog
边栏推荐
- leetcode. 13 --- Roman numeral to integer
- What are the indicators of VIKOR compromise?
- 企业全面云化的时代——云数据库的未来
- 第五天 脚本与UI系统
- Word2vec, phrases, phraser, keyedvectors commonly used in gensim
- How to calculate the D value and W value of statistics in normality test?
- With the beauty of technology enabled design, vivo cooperates with well-known art institutes to create the "industry university research" plan
- Luogu p6822 [pa2012]tax (shortest circuit + edge change point)
- Use pytorch to build mobilenetv2 and learn and train based on migration
- Rank sum ratio (RSR) index calculation
猜你喜欢

VOCALOID notes

With the beauty of technology enabled design, vivo cooperates with well-known art institutes to create the "industry university research" plan

Static web server

What about the exponential smoothing index?

Index analysis of DEMATEL model

Scanpy (VII) spatial data analysis based on scanorama integrated scrna seq

leetcode.13 --- 罗马数字转整数

How to interpret the information weight index?

Overview of image super score: the past and present life of image super score in a single screen (with core code)

Log in to MySQL 5.7 under ubuntu18 and set the root password
随机推荐
Retrieval model rough hnsw
InfluxDB时序数据库
[thesis study] vqmivc
FFT [template]
Stm32cubemx learning (5) input capture experiment
2022年毕业生求职找工作青睐哪个行业?
4 raisons inconnues d'utiliser le "déplacement sûr à gauche"
Niuke: flight route (layered map + shortest path)
Electronics: Lesson 008 - Experiment 6: very simple switches
使用pytorch搭建MobileNetV2并基于迁移学习训练
Can I grant database tables permission to delete column objects? Why?
想转行学软件测试担心哪些问题?
Is it safe to open an account online? Xiaobai asks for guidance
Measure the current temperature
Luogu p5994 [pa2014]kuglarz (XOR thinking +mst)
Find out the possible memory leaks caused by the handler and the solutions
The era of enterprise full cloud -- the future of cloud database
420 sequence traversal of binary tree 2 (429. sequence traversal of n-ary tree, 515. find the maximum value in each tree row, 116. fill in the next right node pointer of each node, 104. maximum depth
家庭服务器门户Easy-Gate
使用apt-get命令如何安装软件?