Based on Apple Concurrency Programming Guide and Grand Central Dispatch (GCD). There are two options for GCD calls.
"Block" Flavor. dispatch_block_t
a fragrance that can use the standard Swift closure:
void dispatch_async( dispatch_queue_t queue,
dispatch_block_t block );
In cases where a block lock allocates storage on the stack
typedef void (^dispatch_block_t)(void);
"Function" Aroma. An attribute dispatch_function_t
that has a context object and a function pointer.
void dispatch_async_f( dispatch_queue_t queue,
void *context,
dispatch_function_t work );
The context object assigned to applications is passed to the submit function work
as a parameter to the object pointer void *
.
typedef void (*dispatch_function_t)(void *);
_f
, dispatch_async_f
dispatch_sync_f
, .
?
- , Grand Central Dispatch _f
context + fuction Swift?