当前位置:网站首页>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
边栏推荐
- TCP MIN_ A dialectical study of RTO
- Electronics: Lesson 009 - Experiment 7: study relays
- Daily question brushing record (III)
- How to calculate the fuzzy comprehensive evaluation index? How to calculate the four fuzzy operators?
- 初识生成对抗网络(12)——利用Pytorch搭建WGAN-GP生成手写数字
- Log in to MySQL 5.7 under ubuntu18 and set the root password
- 想要软件测试效果好,搭建好测试环境是前提
- Use Adobe Acrobat pro to resize PDF pages
- Go language learning tutorial (13)
- How do I install the software using the apt get command?
猜你喜欢
堆栈认知——栈溢出实例(ret2libc)
Allgero reports an error: program has encoded a problem and must exit The design will be saved as a . SAV file
NIPS 2014 | Two-Stream Convolutional Networks for Action Recognition in Videos 阅读笔记
Sword finger offer (simple level)
什么是SKU和SPU,SKU,SPU的区别是什么
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
With the beauty of technology enabled design, vivo cooperates with well-known art institutes to create the "industry university research" plan
Rank sum ratio (RSR) index calculation
使用apt-get命令如何安装软件?
How to analyze the grey prediction model?
随机推荐
How to calculate the information entropy and utility value of entropy method?
TS environment setup
堆栈认知——栈溢出实例(ret2libc)
4个不可不知的采用“安全左移”的理由
图像超分综述:超长文一网打尽图像超分的前世今生 (附核心代码)
Daily question brushing record (III)
是否可以给数据库表授予删除列对象的权限?为什么?
Log in to MySQL 5.7 under ubuntu18 and set the root password
TCP and UDP
Rosparam statement
CVPR 2022 Oral 2D图像秒变逼真3D物体
STM32CubeMX 学习(5)输入捕获实验
leetcode. 13 --- Roman numeral to integer
Free SSL certificate acquisition tutorial
Overview of image super score: the past and present life of image super score in a single screen (with core code)
Luogu p6822 [pa2012]tax (shortest circuit + edge change point)
How to interpret the information weight index?
Nips 2014 | two stream revolutionary networks for action recognition in videos reading notes
股票网上开户安全吗?小白求指导
Deep learning series 48:deepfaker