dispatch(3)
β¨ dispatch(3) β the dispatch framework β¨
okay bestie, gather round, because we're talking about dispatch, aka the dispatch framework, from the library functions manual. this is the group chat of concurrency and it always shows up on time. π
πΈ SYNOPSIS πΈ
#include <dispatch/dispatch.h>
that's it. that's the whole vibe. one include and you're in. π
π¦ DESCRIPTION π¦
so like. the dispatch framework lets blocks get scheduled for asynchronous and concurrent execution β via the core functions described over in dispatch_async(3) and dispatch_apply(3). yes, blocks. doing things. at the same time. not me being obsessed with parallelism π
Dispatch queues are the basic units of organization of blocks. several queues are created by default (they just exist, main character energy, they don't need an invite), and applications may create additional queues for their own use. see dispatch_queue_create(3) for more info. π§
Dispatch groups let applications track the progress of blocks submitted to queues, and take action when those blocks complete. it's giving "tell me when everyone's done so we can leave." see dispatch_group_create(3) for more info. π«Ά
and the dispatch framework also provides functions to monitor underlying system events and automatically submit event handler blocks to dispatch queues. yes queen, it's watching and it's handling. π₯
π SEE ALSO π
dispatch_after(3)dispatch_api(3)dispatch_apply(3)dispatch_async(3)dispatch_data_create(3)dispatch_group_create(3)dispatch_io_create(3)dispatch_io_read(3)dispatch_object(3)dispatch_once(3)dispatch_queue_create(3)dispatch_semaphore_create(3)dispatch_source_create(3)dispatch_time(3)
bestie fr fr: go read those. they're the whole supporting cast and they ate. π
this has been the Darwin edition of dispatch(3), dated May 1, 2009 β old money, still iconic, no cap. πβ¨π
π¦ where this page comes from
- alpine 3.24: libdispatch-doc 6.1.2-r0 Β· Apache-2.0
- arch rolling: libdispatch 6.2.2-1 Β· Apache-2.0
- epel 10: libdispatch 1:6.0.2-1.el10_0 Β· Apache-2.0
- epel 9: libdispatch 1:6.0.2-1.el9 Β· Apache-2.0
- fedora 43: libdispatch 1:6.0.2-3.fc43 Β· Apache-2.0
- fedora 44: libdispatch 1:6.0.2-3.fc43 Β· Apache-2.0
- fedora 44: libdispatch 1:6.0.2-4.fc44 Β· Apache-2.0
- nixos 26.05: swift-corelibs-libdispatch 5.10.1
- opensuse-leap 16.0: libdispatch-devel 5.6.3-bp160.1.1 Β· Apache-2.0
- Copyright (c) 2008-2012 Apple Inc. All rights reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms