Grand Central Dispatch - Features

Features

The dispatch framework declares several data types and functions to create and manipulate them:

  • Dispatch Queues are objects that maintain a queue of tasks, either anonymous code blocks or functions, and execute these tasks in their turn. The library automatically creates several queues with different priority levels that execute several tasks concurrently, selecting the optimal number of tasks to run based on the operating environment. A client to the library may also create any number of serial queues, which execute tasks in the order they are submitted, one at a time. Because a serial queue can only run one task at a time, each task submitted to the queue is critical with regard to the other tasks on the queue, and thus a serial queue can be used instead of a lock on a contended resource.
  • Dispatch Sources are objects that allow the client to register blocks or functions to execute asynchronously upon system events, such as a socket or file descriptor being ready for reading or writing, or a POSIX signal.
  • Dispatch Groups are objects that allow several tasks to be grouped for later joining. Tasks can be added to a queue as a member of a group, and then the client can use the group object to wait until all of the tasks in that group have completed.
  • Dispatch Semaphores are objects that allow a client to permit only a certain number of tasks to execute concurrently.

Read more about this topic:  Grand Central Dispatch

Famous quotes containing the word features:

    However much we may differ in the choice of the measures which should guide the administration of the government, there can be but little doubt in the minds of those who are really friendly to the republican features of our system that one of its most important securities consists in the separation of the legislative and executive powers at the same time that each is acknowledged to be supreme, in the will of the people constitutionally expressed.
    Andrew Jackson (1767–1845)

    The features of our face are hardly more than gestures which force of habit made permanent. Nature, like the destruction of Pompeii, like the metamorphosis of a nymph into a tree, has arrested us in an accustomed movement.
    Marcel Proust (1871–1922)

    These, then, will be some of the features of democracy ... it will be, in all likelihood, an agreeable, lawless, particolored commonwealth, dealing with all alike on a footing of equality, whether they be really equal or not.
    Plato (c. 427–347 B.C.)