当前位置:网站首页>GCD summary
GCD summary
2022-07-28 23:16:00 【Fluttering moth】
What is? GCD
It's one of the technologies to execute tasks asynchronously . Generally, the code used for thread management of technology in applications is implemented at the system level . Developers only need to define the tasks they want to perform and append them to the appropriate Dispatch Queue in ,GCD You can generate the necessary threads and schedule tasks . As a part of the system , More efficient than previous threads .
dispatch_async(queue, ^
{
/**
* Long time processing
*
* for example AR Image recognition
* For example, database access
*/
/**
* End of long processing , The main thread uses this processing result .
*/
dispatch_async(dispatch_get_main_queue(), ^
{
/**
* Only in the processing that the main thread can execute
* For example, user interface update
*/
});
});Multithreaded programming
1 individual CPU Executive CPU The command line is a Forkless path , The thread .
This bifurcated path is not only 1 strip , Multithreading occurs when there are multiple threads . In multithreading ,1 individual CPU The core executes different commands on multiple different paths .
Due to the use of multithreading, context switching can be repeated many times between a thread and other threads , So it looks like 1 individual CPU The core can execute multiple threads in parallel . And there are multiple CPU In the case of nuclear , It doesn't look like , It really provides multiple CPU The technology of executing multiple threads in parallel with the kernel .
Possible problems of multithreading :
Data competition 、 Deadlock 、 Too many threads consume a lot of memory .
But using multithreaded programming can ensure the response performance of the application .
边栏推荐
- Migration from IPv4 to IPv6
- One of the experience of solving problems with code error reporting: CUDA does not match pytorch
- 【图像分割】基于方向谷形检测实现静脉纹路分割附MATLAB代码
- Cnpm installation steps
- Hbuilderx shortcut key
- leetcode101. 对称二叉树
- Summary of core functions of software testing tool Fiddler postman JMeter charlse
- Rouyi cloud platform - how to realize the launch and login functions of the project and how to create new modules
- The US FCC provided us $1.6 billion to support domestic operators to remove Huawei and ZTE equipment
- 安全狗入选《云安全全景图2.0》多个细项
猜你喜欢
![[physical application] Wake induced dynamic simulation of underwater floating wind turbine wind field with matlab code](/img/31/e4cd4c261a7fc5cfa731976314530b.png)
[physical application] Wake induced dynamic simulation of underwater floating wind turbine wind field with matlab code

Cglib create proxy

NPM run dev, automatically open the browser after running the project

Improvement 13 of yolov5: replace backbone network C3 with lightweight network efficientnetv2

【图像分割】基于方向谷形检测实现静脉纹路分割附MATLAB代码

WebView optimization

Introduction to address book export without code development platform

Nacos配置热更新的4种方式、读取项目配置文件的多种方式,@value,@RefreshScope,@NacosConfigurationProperties

There are four ways for Nacos to configure hot updates and multiple ways to read project configuration files, @value, @refreshscope, @nacosconfigurationproperties

18张图,直观理解神经网络、流形和拓扑
随机推荐
【MySQL系列】 MySQL表的增删改查(进阶)
sql优化常用的几种方法
《Shortening passengers’ travel time A dynamic metro train scheduling approach using deep reinforcem》
Thesis reading (2) - vggnet of classification
Shell script foundation - shell operation principle + variable and array definitions
【滤波跟踪】基于EKF、时差和频差定位实现目标跟踪附matlab代码
Servlet的使用手把手教学(一)
Thesis reading (3) - googlenet of classification
Summary of core functions of software testing tool Fiddler postman JMeter charlse
业界首创云原生安全检测双模型!安全狗重磅报告亮相数字中国建设峰会
MySQL foundation - advanced functions
Seagate released a new risc-v architecture processor: the performance of mechanical hard disk soared 3 times
PCA学习
One of the experience of solving problems with code error reporting: CUDA does not match pytorch
Wheel 6: qserialport serial port data transceiver
Target detection notes fast r-cnn
Yolov5 improvement 12: replace backbone network C3 with lightweight network shufflenetv2
Terminal output G_ Debug() information
Recurrent neural network (RNN)
Nacos配置热更新的4种方式、读取项目配置文件的多种方式,@value,@RefreshScope,@NacosConfigurationProperties