gcd其全称(Grand Central Dispatch) 那到底什么叫gcd,官方的解释如下
来源:互联网 发布:excel表格重复的数据 编辑:程序博客网 时间:2024/04/29 06:00
GCD provides and manages FIFO queues to which your application can submit tasks in the form of block objects. Blocks submitted to dispatch queues are executed on a pool of threads fully managed by the system. No guarantee is made as to the thread on which a task executes. GCD offers three kinds of queues:
Main:
tasks execute serially on your application’s main thread Concurrent:
tasks are dequeued in FIFO order, but run concurrently and can finish in any order. Serial:
tasks execute one at a time in FIFO order
The main queue is automatically created by the system and associated with your application’s main thread. Your application uses one (and only one) of the following three approaches to invoke blocks submitted to the main queue:
Calling
dispatch_main
Calling
UIApplicationMain
(iOS) or NSApplicationMain
(OS X) Using a
CFRunLoopRef
on the main thread
Use concurrent queues to execute large numbers of tasks concurrently. GCD automatically creates three concurrent dispatch queues that are global to your application and are differentiated only by their priority level. Your application requests these queues using the dispatch_get_global_queue
Use serial queues to ensure that tasks to execute in a predictable order. It’s a good practice to identify a specific purpose for each serial queue, such as protecting a resource or synchronizing key processes. Your application must explicitly create and manage serial queues. It can create as many of them as necessary, but should avoid using them instead of concurrent queues just to execute many tasks simultaneously.
Important:
dispatch_async
dispatch_async_f
dispatch_sync
dispatch_sync_f
dispatch_after
dispatch_after_f
dispatch_apply
dispatch_apply_f
dispatch_once
dispatch_async
dispatch_async_f比较,它们之音的区别就是多了一个_f,再就是用_f多了一个参数,其它的好像没什么区别,官网上也没查到
//
//
//
- gcd其全称(Grand Central Dispatch) 那到底什么叫gcd,官方的解释如下
- Grand Central Dispatch (GCD)
- GCD(Grand Central Dispatch)
- Grand Central Dispatch(GCD)
- Grand Central Dispatch (GCD
- Grand Central Dispatch (GCD)
- GCD(Grand Central Dispatch)
- GCD(Grand Central Dispatch)
- GCD(Grand Central Dispatch)
- GCD (Grand Central Dispatch)
- GCD(Grand Central Dispatch)
- Grand Central Dispatch(GCD)
- GCD (Grand Central Dispatch)
- GCD(Grand Central Dispatch)
- GCD(Grand Central Dispatch)的使用方法
- iOS Grand Central Dispatch(GCD)
- Grand Central Dispatch (GCD) Reference
- IOS GCD ---- Grand Central Dispatch
- functools.partial
- js后缀文件中获取请求路径的方法
- mysql数据类型总结
- Android textview实现删除线
- OCI编程
- gcd其全称(Grand Central Dispatch) 那到底什么叫gcd,官方的解释如下
- C++作业:将左右孩子互换 / 复制一棵二叉树
- Windows下命令行下启动ORACLE服务
- NSLog输出的格式
- windows Server 2008 64位 Tomcat做为服务_Web服务器
- 关于Android读取不同位置(drawable,asset,SDCard)的图片资源的总结(转)
- STL string未提供的方法
- win socket 编程学习与理解
- 视频刻录代码MediaRecorder