GCD使用(六)串行队列的构造

iOS-多线程编程学习之GCD——串行队列和并发队列(五) Grand Central Dispatch(GCD)有很多部分构成,例如有很好的语言特性,运行库,还提供了系统的、高效的方式来支持具有多核处理器的iOS和OS X设备进行并发事件处理。   BSD子系统,CoreFoundation和Cocoa APIs都已经使用这个增强特性来进行扩展了,因为它可以使得你的系统和应用运行的更快,更有效率,响应更及时。 阅读详情

1。串行队列:

      FIFO方式,并发时的异步操作不会在主线程进行 

   dispatch_queue_create(CStringID , 0): CStringID形式-com.COMPANY.PRODUCT.ID,不需要加@

e.g.

    //串行队列,非mainQueue,非globalQueue

    dispatch_queue_t firstSerialQueue = dispatch_queue_create("com.pixolity.GCD.serialQueue1", 0);

    

    //虽然是异步操作,但仍是FIFO,因为是在自己构造的串行队列中执行

    dispatch_async(firstSerialQueue, ^{

        NSUInteger counter = 0;

        for (counter = 0;

             counter < 5;

             counter++){

            NSLog(@"First iteration, counter = %lu", (unsigned long)counter);

        }

    });    

    dispatch_async(firstSerialQueue, ^{

        NSUInteger counter = 0;

        for (counter = 0;

             counter < 5;

             counter++){

            NSLog(@"Second iteration, counter = %lu", (unsigned long)counter);

        }

    });


    dispatch_async(firstSerialQueue, ^{

        NSUInteger counter = 0;

        for (counter = 0;

             counter < 5;

             counter++){

            NSLog(@"Third iteration, counter = %lu", (unsigned long)counter);

        }

    });

e.g.

  C函数

void firstIteration(void *paramContext){ 

    NSUInteger counter = 0;

    for (counter = 0;

         counter < 5;

         counter++){

        NSLog(@"%@ iteration, counter = %lu",paramContext, (unsigned long)counter);

    }

}

- (void) actionSerial{  

    dispatch_queue_t firstSerialQueue =  dispatch_queue_create("com.pixolity.GCD.serialQueue1", 0);

    dispatch_async_f(firstSerialQueue, (__bridge void *)( @"First"), firstIteration);

    dispatch_async_f(firstSerialQueue, (__bridge void *)( @"Second"), firstIteration);

    dispatch_async_f(firstSerialQueue, (__bridge void *)( @"Third"), firstIteration);

}



【多线程-第二天-GCD的队列介绍-串行队列 Objective-C语言】 阅读详情

相关推荐

GCD编程中串行、并行、同步、异步的执行顺序

串行队列、并行队列、同步、异步是gcd编程中四个非常重要的概念,它们的组合会产生多种不同的执行顺序,在本文,我主要通过代码来罗列一下所有的可能产生的结果,并根据执行结果总结一下gcd编程的一些特点。

feisongfeiqin的博客 6055

GCD 串行队列、并发队列以及同步执行、异步执行

dispatch_async 如果调度到同一个串行队列上,第一次异步调度时会开启一个新线程,后续异步调度会在第一次创建的线程上运行,但肯定会顺序执行。dispatch_sync 任务将在当前线程执行,若同步调度任务到并发队列上,则所有任务在当前线程顺序执行。并行队列:调度任务到并行队列, 将开启多个线程,任务执行结束的顺序无法确定。dispatch_async 如果调度到同一个并行队列上, 将开多个新线程执行,任务乱序执行。串行队列: 调度任务到串行队列,任务将在同一个线程执行,并且顺序执行。

老猿的自留地 831

Objective C 高级进阶— GCD队列浅析(一)

@autoreleasepool { returnUIApplicationMain(argc, argv,nil,NSStringFromClass([AppDelegateclass])); }

疯狂原始人 8452

GCD队列和调度组

GCD的队列可以分为2大类型,分别为串行队列和并发队列 串行队列(Serial Dispatch Queue): 一次只调度一个任务,队列中的任务一个接着一个地执行(一个任务执行完毕后,再执行下一个任务) 创建一个队列 dispatch_queue_t q = dispatch_queue_create(const char *label, dispatch_queue_attr_t attr) 参数: const char *label:队列的名称 ...

小天空的博客 534

python数据处理与分析案例,python如何进行数据处理

大家好,本文将围绕基于python的数据处理案例展开说明,python数据处理与分析案例是一个很多人都想弄明白的事情,想搞清楚python如何进行数据处理需要先了解以下几个事情。大家好,小编来为大家解答以下问题,python数据处理案例步骤及其代码,python数据处理与分析教程,今天让我们一起来看看吧!哈喽~今天学习记录的是数据分析实训小案例。就用这个案例来好好巩固一下 python 数据分析三剑客。

a17348的博客 1237

MOOS-ivp 实验三 MOOS简介(1)

系列文章目录 提示:这里可以添加系列文章的所有文章的目录,目录需要自己手动添加 例如:第一章 Python 机器学习入门之pandas的使用 提示:写完文章后,目录可以自动生成,如何生成可参考右边的帮助文档 文章目录系列文章目录前言一、pandas是什么?二、使用步骤1.引入库2.读入数据总结 前言 提示:这里可以添加本文要记录的大概内容: 例如:随着人工智能的不断发展,机器学习这门技术也越来越重要,很多人都开启了学习机器学习,本文就介绍了机器学习的基础内容。 提示:以下是本篇文章正文内容,下面案例

weixin_44151170的博客 7434

多线程——GCD(串行队列)

无论队列中所指定的执行的函数是同步还是异步,都会等待前一个任务执行完成后,再调度后面的任务 要不要开线程由执行任务决定 dispatch_sync 不开 dispatch_async 开 开几条线程由谁决定 串行队列,异步执行,开几条,由底层线程池决定 串行队列,同步执行,不开线程 串行队列,异步执行任务 - (void)gcdDemo1 { for (NSInteger index =

iOS开发 1万+

复数值神经网络可能是深度学习的未来

复数这种东西,在人的头脑中似乎抽象、似乎复杂,然而,对于计算机来说,一点也不抽象,不复杂,那么,将复数概念推广到神经网络会是什么结果呢?本篇介绍国外的一些同行的尝试实践,请我们注意观察他们的进展。

gongdiwudu的专栏 6613

ZOJ 1577 - GCD & LCM

GCD & LCM Time Limit: 2 Seconds      Memory Limit: 65536 KB Given x and y (2 1) p and q are positive integers; 2) GCD(p, q) = x; 3) LCM(p, q) = y. Input x and y, one line for each test.

GooMaple 1064

手把手打通全流程:在华为昇腾310/Atlas 200DK上实现深度学习模型从移植到部署

通过以上步骤,你已成功在华为昇腾310 Atlas 200DK上完成深度学习模型的移植与推理。这一流程可复用到目标检测、语义分割等其他任务,快去尝试将自己的AI模型部署到昇腾设备上,打造属于你的边缘智能应用吧!上部署深度学习模型,这篇教程将带你走完从模型转换到推理运行的完整流程。无需担心技术壁垒,我们以通俗易懂的方式拆解每一步,让你轻松在昇腾嵌入式设备上实现AI应用。是专为边缘AI设计的高性能处理器,Atlas 200DK是其开发板形态,能高效运行图像分类、目标检测等深度学习任务。

FJN110的博客 181

MATLAB地理数据处理 25:植被物候提取及分析模型优化(Savitzky-Golay)

之前我写过一篇使用Savitzky-Golay处理遥感数据,获取地面物候信息的MATLAB代码,但是发现存在一些问题:对物候开始期和物候结束期的阈值设定都为相同值,但是有些研究中,需要根据不同的环境条件,设置不同的物候阈值,所以对其进行相应的修改。

amyniez的博客,欢迎交流讨论 2232

iOS开发多线程篇—GCD介绍

iOS开发多线程篇—GCD介绍 一、简单介绍 1.什么是GCD? 全称是Grand Central Dispatch,可译为“牛逼的中枢调度器” 纯C语言,提供了非常多强大的函数   2.GCD的优势 GCD是苹果公司为多核的并行运算提出的解决方案 GCD会自动利用更多的CPU内核(比如双核、四核) GCD会自动管理线程的生命周期(创建线程、调度任务、销毁线程) 程序员只需要告...

weixin_33892359的博客 360

cilium native-routing模式流程分析

本文分析cilium native routing模式下的报文路径和涉及到的ebpf源码分析。实验环境在vxlan模式下修改参数后而来。native routing和vxlan模式的区别主要是跨节点通信时,vxlan模式需要封装,native routing模式需要根据目的ip查找路由表转发到其他节点。

fengcai_ke的博客 987

GCD实践——串行队列/并发队列与iOS多线程详解

1.串行队列一次只执行一个线程,按照添加到队列的顺序依次执行; 2.并发队列一次可以执行多个线程,线程的执行没有先后顺序; 3.UI界面所在的线程队列是串行队列。 下面我对上述几个案例进行代码示例:项目已经上传至github:               。中的GCD01项目。 【串行队列示例】 (1)首先导入GCD源码,可以从我的项目中直接复制,总共9个文件: 。

乞力马扎罗的雪CYF的博客 7117

银河麒麟操作系统最佳实践专栏介绍

本专栏聚焦国产银河麒麟操作系统(桌面版/服务器版)的实战应用,提供系统安装、配置优化、应用部署、故障排查等实用指南。内容基于真实操作场景,涵盖Linux通用技术(如RAID配置、环境变量管理)、服务器系统专项(如数据库迁移、驱动安装、安全加固)及桌面系统技巧(如PXE安装、镜像封装)。面向IT运维、开发者和国产化转型人员,突出实战性和差异化,帮助用户规避常见问题,提升系统管理效率。所有教程均配有详细步骤和截图,确保可操作性,并持续更新适配新版系统。

信创运维工程师 · 银河麒麟 & 容器实战 | 金融生产环境迁移·等保加固 | 142篇原创·17万+阅读 530

2025华为杯第二十二届中国研究生数学建模竞赛E题:高速列车轴承智能故障诊断问题 - 完整解题分析+完整MATLAB源码!

🎓 本文收录于 《滚雪球学数学建模》专栏,本专栏专注于从零基础出发,带你循序渐进掌握数学建模的核心方法与思维路径。通过“滚雪球式”学习法,从最简单的生活化案例到经典建模工具,再到省赛、国赛真题实战演练,逐步积累知识与技能,帮助你搭建完整的建模体系。无论你是刚接触建模的新生,还是希望提升科研与竞赛能力的学者与工程师,本专栏都将为你提供一条清晰、高效、可实操的建模成长路线,助力你快速进阶,突破难点,迈向数学建模竞赛与实际应用的更高峰 🚀!

**My Coding Family** 1991

iOS 多线程--GCD 串行队列、并发队列以及同步执行、异步执行

1 什么是队列(queue) 在开始GCD之前先来说一下队列的概念,因为GCD的任务都是在队列中派发的; 队列(queue):是先进先出(FIFO, First-In-First-Out)的线性表。但是在队列前面加上串行和并发这两个定语之后,也就是串行队列、并发队列,有时就容易搞不清楚了,特别是再加上同步和异步的概念之后,有时就更不清楚了。 2 串行队列和并发队列 注意是并发队列(Concurrent Queue),不是并行队列,关于并发和并行的区别见下一节 什么是串行队列和并发队列呢?上面已经说.

u013712343的博客 3131

jdk-8u144-linux-x64.tar.gz.

该资源为搭建Linux系统Java环境用,资源的后缀为tar.gz格式的压缩包

GCD 的同步任务,异步任务,串行队列,并行队列的理解

队列 串行队列(DISPATCH_QUEUE_SERIAL) :放到串行队列的任务,GCD 会 FIFO(先进先出) 地取出来一个,执行一个,然后取下一个,这样一个一个的执行。 并发队列(DISPATCH_QUEUE_CONCURRENT) :放到并行队列的任务,GCD 也会 FIFO的取出来,但不同的是,它取出来一个就会放到别的线程,然后再取出来一个又放到另一个的线程。这样由于取...

Coder 1328

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

GCD串行并发队列扫盲

概述 本篇一起来学习GCD队列相关知识及如何使用。一直以来都是看到过别人这么用,说实在的,还真没有学过文档,也没有深入研究过其所以然。今天一起来看看苹果的GCD队列相关知识,扫一扫盲区吧! 学习完本篇,您会对以下知识点更加理解: 队列串行队列并发队列GCD全局队列GCD主队列创建串行队列创建并发队列 队列基础知识 在大学学习过队列、栈数据结构吧?如果学习过,应该是非常容易理解的。不管

逢个场,作个戏 1077

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

关于GCD中串行队列、并发队列和同步执行、异步执行的探讨

Dispatch Queues Dispatch queue是一个对象,它可以接收任务,并将任务以先到先执行的顺序来执行。Dispatch queue可以使并发的或串行的。并发任务会基于系统负载来合适地并发执行,串行队列同一时间只执行单一任务。 GCD共有三种队列类型: 1、main queue:通过dispatch_get_main_queue()获得,这是一个与主线程相关的串行队列。

邓波的技术博客 4712

GCD的简单使用——同步、异步、串行、并发的具体剖析

什么是GCD? 全称是Grand Central Dispatch 可译为 “牛逼的中枢调度器” 纯C语言,提供了非常多强大的函数。 GCD的优势 GCD是苹果公司为多核的并行运算提出的解决方案 GCD会自动利用更多的CPU内核(比如双核、四核) GCD会自动管理线程的生命周期(创建线程、调度任务、销毁线程) 程序员只需要告诉GCD想要执行什么任务,不需要编写任何线程管理的代码。

1864

GCD 中的队列

GCD 中的队列 GCD 所提供的 API 虽然简单,但是十分强大。其提供了两种类型的队列,一种串行队列,一种并行队列。 提交到串行队列中的 block 任务遵循先进先出的顺序,由系统维护的线程池中的线程执行。虽然任务的执行线程是不确定的, 但是同一个时刻,同一个队列中的任务只会有一个任务在执行。但是,不同串行队列中的任务是并行的。 提交到并行队列中的任务则不同,系统会根据需要创建线程,并行执行队...

集腋成裘 1533

iOS详解 GCD 串行队列并行队列

iOS串行和并行队列, GCD

pangshishan1的博客 2153

GCD之 串行队列,并行队列,全局队列,主线程队列

/* 进程:正在进行中的程序被称为进程,负责程序运行的内存分配 线程:是进程中一个独立的执行路径,负责程序中代码的实际运行 1.一个进程中至少包含一条线程。可以将耗时的执行路径放在其他线程中执行 2.创建线程的目的就是为了开启一条新的执行路径,运行指定的代码,与主线程中的代码实现同时运行。 3.线程没有完成之前不能被杀掉,但是可以暂停,休眠。 4.并发:指两个或多个

gujinyue 1006

并发编程 - GCD的任务和队列

本篇博客篇幅较长,但这只是 GCD 的入门介绍。事实上,我们讨论的内容还算基础,仅涉及了队列和任务的创建,以及它们如何组合在一起工作。然而,掌握这些基础概念是深入理解 GCD 并有效应用其强大功能的第一步。未来还有更多复杂的机制和高级用法等待我们探索。希望通过这篇文章,你对 GCD 有了初步的认识,以后的博客我们会继续探讨GCD以及其它并发编程相关的内容。

weixin_39339407的博客 1244

iOS-GCD的串行队列和并行队列的任务及实现

什么是GCD GCD全称是GrandCentral Dispatch,纯C语言的,提供了非常多强大的函数 •GCD的优势 1,GCD是苹果公司为多核的并行运算提出的解决方案 2,GCD会自动利用更多的CPU内核(比如双核、四核) 3,GCD会自动管理线程的生命周期(创建线程、调度任务、销毁线程) 4,程序员只需要告诉GCD想要执行什么任务,不需要编写任何线程管理代码

CuiAnkly的博客 1万+
上一篇: GCD使用(五)分组操作(group)
下一篇: NSTimer的简单使用
berained
博客等级 码龄20年 14粉丝 15原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值