Operation Queues

An operation queue is the Cocoa equivalent of a concurrent dispatch queue and is implemented by the NSOperationQueue class. Whereas dispatch queues always execute tasks in first-in, first-out order, operation queues take other factors into account when determining the execution order of tasks. Primary among these factors is whether a given task depends on the completion of other tasks. You configure dependencies when defining your tasks and can use them to create complex execution-order graphs for your tasks.

The tasks you submit to an operation queue must be instances of the NSOperation class. An operation object is an Objective-C object that encapsulates the work you want to perform and any data needed to perform it. Because the NSOperation class is essentially an abstract base class, you typically define custom subclasses to perform your tasks. However, the Foundation framework does include some concrete subclasses that you can create and use as is to perform tasks.

Operation objects generate key-value observing (KVO) notifications, which can be a useful way of monitoring the progress of your task. Although operation queues always execute operations concurrently, you can use dependencies to ensure they are executed serially when needed.

For more information about how to use operation queues, and how to define custom operation objects, see Operation Queues.

https://developer.apple.com/library/content/documentation/General/Conceptual/ConcurrencyProgrammingGuide/ConcurrencyandApplicationDesign/ConcurrencyandApplicationDesign.html#//apple_ref/doc/uid/TP40008091-CH100-SW8

最新文章

  1. SymmetricDS 快速和灵活的数据库复制
  2. Codeforces Round #361 (Div. 2) B
  3. 第二章 JavaScript语法·
  4. google搜索技巧汇总
  5. 转:python webdriver API 之简单对象的定位
  6. HashMap循环遍历方式及其性能对比(zhuan)
  7. c++ swap 函数
  8. OpenShare文档中心
  9. CUDA获取显卡数据
  10. 从3dmax中导入模型到UDK Editor(供个人备忘)
  11. hadoop笔记之hdfs shell操作
  12. C#深复制与浅复制
  13. UVa 136 - Ugly Numbers
  14. ACM Let the Balloon Rise
  15. [Abp 源码分析]七、仓储与 Entity Framework Core
  16. JavaScript—面向对象开发详解和垃圾回收
  17. Django Admin初识
  18. [sharepoint]修改Item或者File的Author和Editor
  19. 提高delete效率方法
  20. Vuex 页面刷新后store保存的数据会丢失 取cookie值

热门文章

  1. Ubuntu 16.04安装XMind 8
  2. JAVA学习第四十一课 — 泛型的基本应用(一)
  3. Python网络爬虫(一):初步认识网络爬虫
  4. jQuery 插件开发全解析
  5. 微软公有云Azure是惠及全人类的计算资源
  6. oc80--copy
  7. git分支的合并和冲突解决【转】
  8. [BZOJ 3126] Photo
  9. 洛谷 P4149 [ IOI 2011 ] Race —— 点分治
  10. php的类型转换