Some background:
1. This is a thread pool, but it's system-wide. The kernel knows best (how
to allocate threads), so it is in control.
2. It's lower-level than Cocoa / OpenStep. It is not related to them and it
does not require them. A unix app written for the K Desktop Environment
could be written to use Grand Central Dispatch.
3. It requires Blocks. This means you must use LLVM and C, Obj-C, or C++.
4. It's very easy to use. The following is an example from Ars Technica's
explanation. The `dispatch` lines instruct GCD to create a task (containing
another task) that will be assigned to a thread.

  - (IBAction)analyzeDocument:(NSButton *)sender 
  { 
    dispatch_async(dispatch_get_global_queue(0, 0), ^{
      NSDictionary *stats = [myDoc analyze]; 
      dispatch_async(dispatch_get_main_queue(), ^{
        [myModel setDict:stats]; 
        [myStatsView setNeedsDisplay:YES]; 
        [stats release];
      });
    });
  }

--Tycho Martin Clendenny
-- 
View this message in context: 
http://www.nabble.com/Grand-Central-Dispatch-tp25401545p25408068.html
Sent from the GNUstep - General mailing list archive at Nabble.com.



_______________________________________________
Discuss-gnustep mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnustep

Reply via email to