About dispatch_queue_t的线程调度
2014-04-03 16:18
330 查看
dispatch_queue_t
A dispatch queue is a lightweight object to which your application submits blocks for subsequent execution.
typedef struct dispatch_queue_s *dispatch_queue_t;
Discussion
A dispatch queue invokes blocks submitted to it serially in FIFO order. A serial queue invokes only one block at a time, but independent queues may each invoke their blocks concurrently with respect to each other.
The global concurrent queues invoke blocks in FIFO order but do not wait for their completion, allowing multiple blocks to be invoked concurrently.
The system manages a pool of threads that process dispatch queues and invoke blocks submitted to them. Conceptually, a dispatch queue may have its own thread of execution, and interaction between queues is highly asynchronous.
Dispatch queues are reference counted via calls to dispatch_retain and dispatch_release. Pending blocks submitted to a queue also hold a reference to the queue until they have finished. Once all references to a queue have been released, the queue will be deallocated by the system.
Availability
Available in iOS 4.0 and later.
Declared In
dispatch/queue.h
关于dispatch_queue_t的系统线程处理,系统维护了一个线程池,dispatch queues中的blocks会提交给线程池中的线程进行处理。一个dispatch queue可能拥有自己的线程执行任务,不同queues之间是高度异步的。
A dispatch queue is a lightweight object to which your application submits blocks for subsequent execution.
typedef struct dispatch_queue_s *dispatch_queue_t;
Discussion
A dispatch queue invokes blocks submitted to it serially in FIFO order. A serial queue invokes only one block at a time, but independent queues may each invoke their blocks concurrently with respect to each other.
The global concurrent queues invoke blocks in FIFO order but do not wait for their completion, allowing multiple blocks to be invoked concurrently.
The system manages a pool of threads that process dispatch queues and invoke blocks submitted to them. Conceptually, a dispatch queue may have its own thread of execution, and interaction between queues is highly asynchronous.
Dispatch queues are reference counted via calls to dispatch_retain and dispatch_release. Pending blocks submitted to a queue also hold a reference to the queue until they have finished. Once all references to a queue have been released, the queue will be deallocated by the system.
Availability
Available in iOS 4.0 and later.
Declared In
dispatch/queue.h
关于dispatch_queue_t的系统线程处理,系统维护了一个线程池,dispatch queues中的blocks会提交给线程池中的线程进行处理。一个dispatch queue可能拥有自己的线程执行任务,不同queues之间是高度异步的。
相关文章推荐
- Buildroot阅读笔记
- DP一题解题报告POJ1141 Brackets Sequence
- IOS UIActivityIndicatorView、UIProgressView
- IOS UISlider
- 百亿级别数据量,又需要秒级响应的案例,需要什么系统支持呢?下面介绍下大数据实时分析工具Yonghong Z-Suite
- iOS基础 -- UIPickerView
- 让easyUI TAB页随页面内的按钮事件变化
- Serial Programming Guide for POSIX Operating Systems 5th Edition Michael R. Sweet Copyright 1994-
- UVA 11995 I Can Guess the Data Structure!
- iOS基础一 UISwitch
- 使用Jenkins Build Android心得
- 玩转Web之easyui(三)-----easy ui dataGird 重新指定url以获取不同数据源信息
- 玩转Web之easyui(三)-----easy ui dataGird 重新指定url以获取不同数据源信息
- 玩转Web之easyui(三)-----easy ui dataGird 重新指定url以获取不同数据源信息
- break ,continue ,return 的区别及作用?
- arquillian + HSQLDB 单元测试问题整理
- builder设计模式的使用以及优缺点
- unable to dequeue a cell with identifier xxx - must register a nib or a class for the identifier
- UI图标不用愁:矢量字体图标Font-Awesome
- 根据map中的value排序map