|
22-09-09 / 00:23 : Apple : article on Grand Central Dispatch Blocks (cjed) | Apple provides an article about programming with Grand Central Dispatch's Blocks :
Block objects (informally, “blocks”) are an extension to C, as well as Objective-C and C++, that make it easy for programmers to define self-contained units of work. Blocks are similar to — but far more powerful than — traditional function pointers. The key differences are:
- Blocks can be defined inline, as “anonymous functions.”
- Blocks capture read-only copies of local variables, similar to “closures” in other languages
This is kind of functionality is common in dynamically-typed interpreted languages, but has never before been widely available to C programmers.
Dispatch queues and dispatch semaphores are also presented. | | Comments | Write a comment | |
|