zoukankan      html  css  js  c++  java
  • About dispatch_queue_t的线程调度

    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之间是高度异步的。

    作者:W.M.steve
    出处:http://www.cnblogs.com/weisteve/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。
  • 相关阅读:
    每天删除和创建表
    一种直接取数的建表语句
    正则替换函数regexp_replace()
    将同个id对应的多行数据,转为一行数组类型数据。使用collect_set() group by函数
    根据客户端标识加载不同的css文件
    配置npm镜像
    解决方案
    oracle virtualbox设置asm虚拟硬盘
    scala基础
    excel合并sheet内容
  • 原文地址:https://www.cnblogs.com/weisteve/p/3053298.html
Copyright © 2011-2022 走看看