@@ -30,14 +30,14 @@ dispatch_apply(iterations, DISPATCH_APPLY_AUTO, ^(size_t idx) {
3030});
3131.Ed
3232.Pp
33- Although any queue can be used, it is strongly recommended to use
33+ Although any queue can be used, it is strongly recommended to use
3434.Vt DISPATCH_APPLY_AUTO
35- as the
36- .Vt queue
35+ as the
36+ .Vt queue
3737argument to both
3838.Fn dispatch_apply
3939and
40- .Fn dispatch_apply_f ,
40+ .Fn dispatch_apply_f ,
4141as shown in the example above, since this allows the system to automatically use worker threads
4242that match the configuration of the current thread as closely as possible.
4343No assumptions should be made about which global concurrent queue will be used.
@@ -75,7 +75,8 @@ for (i = count - (count % STRIDE); i < count; i++) {
7575.Ed
7676.Sh IMPLIED REFERENCES
7777Synchronous functions within the dispatch framework hold an implied reference
78- on the target queue. In other words, the synchronous function borrows the
78+ on the target queue.
79+ In other words, the synchronous function borrows the
7980reference of the calling function (this is valid because the calling function
8081is blocked waiting for the result of the synchronous function, and therefore
8182cannot modify the reference count of the target queue until after the
9596.Fn dispatch_async_f
9697will incur more overhead and does not express the desired parallel execution semantics to
9798the system, so may not create an optimal number of worker threads for a parallel workload.
98- For this reason, prefer to use
99+ For this reason, prefer to use
99100.Fn dispatch_apply
100101or
101102.Fn dispatch_apply_f
@@ -105,18 +106,18 @@ The
105106.Fn dispatch_apply
106107function is a wrapper around
107108.Fn dispatch_apply_f .
109+ .Sh SEE ALSO
110+ .Xr dispatch 3 ,
111+ .Xr dispatch_async 3 ,
112+ .Xr dispatch_queue_create 3
108113.Sh CAVEATS
109114Unlike
110115.Fn dispatch_async ,
111116a block submitted to
112117.Fn dispatch_apply
113118is expected to be either independent or dependent
114119.Em only
115- on work already performed in lower-indexed invocations of the block. If
116- the block's index dependency is non-linear, it is recommended to
117- use a for-loop around invocations of
120+ on work already performed in lower-indexed invocations of the block.
121+ If the block's index dependency is non-linear, it is recommended to use a
122+ for-loop around invocations of
118123.Fn dispatch_async .
119- .Sh SEE ALSO
120- .Xr dispatch 3 ,
121- .Xr dispatch_async 3 ,
122- .Xr dispatch_queue_create 3
0 commit comments