FreeBSD Gets Grand Central Dispatch Port

Not too long ago, Apple open sourced its Grand Central Dispatch library, which aids in developing multithreaded code. It was suggested that it could be ported to other platforms, and the FreeBSD team has done exactly that. They have also done a lot of work related to getting GCD to work in a POSIX environment.

Apart from actually porting the Gand Central Dispatch framework, a number of other things needed to be done do adapt the library for use outside of Mac OS X:

  • Added new kqueue primitives required to support GCD, such as EVFILT_USER and EV_TRIGGER
  • Created autoconf and automake build framework for libdispatch
  • Modified libdispatch to use POSIX semaphores instead of Mach semaphores
  • Adapted libdispatch to use portable POSIX time routines

The other important aspect of getting Gand Central Dispatch to work optimally is a blocks-aware compiler. Jordan Hubbard has worked on providing a blocks-aware clang compiler package for FreeBSD. “When compiled with clang, libdispatch provides blocks-based, as well as function-based callbacks.”

You can find the current port in the ports collection, but for the future, it’s going to work out-of-the-box. “After FreeBSD 8.0-RELEASE has shipped, the new kqueue primitives will be MFC’d so that libdispatch works out of the box on FreeBSD 8.1-RELEASE.” They are also investigating any possible benefits it might bring to modify FeeBSD base operating system tools to use GCD.

65 Comments

  1. 2009-10-13 6:56 pm
    • 2009-10-13 7:05 pm
    • 2009-10-13 7:11 pm
      • 2009-10-13 8:20 pm
        • 2009-10-13 9:34 pm
        • 2009-10-13 9:35 pm
          • 2009-10-14 2:45 am
          • 2009-10-14 5:12 am
          • 2009-10-14 1:21 pm
    • 2009-10-13 7:43 pm
      • 2009-10-13 7:47 pm
      • 2009-10-13 7:47 pm
      • 2009-10-13 7:53 pm
        • 2009-10-13 8:05 pm
        • 2009-10-13 8:09 pm
          • 2009-10-13 8:16 pm
          • 2009-10-13 8:23 pm
          • 2009-10-13 9:33 pm
          • 2009-10-14 12:31 am
          • 2009-10-14 7:04 am
          • 2009-10-14 7:06 pm
          • 2009-10-15 12:17 am
          • 2009-10-13 8:49 pm
          • 2009-10-13 9:54 pm
          • 2009-10-14 12:32 am
          • 2009-10-15 1:38 pm
    • 2009-10-13 11:34 pm
      • 2009-10-14 6:50 am
      • 2009-10-14 1:24 pm
        • 2009-10-17 12:02 pm
  2. 2009-10-13 8:16 pm
  3. 2009-10-13 8:17 pm
  4. 2009-10-13 9:31 pm
    • 2009-10-13 11:22 pm
  5. 2009-10-13 10:02 pm
    • 2009-10-13 11:10 pm
    • 2009-10-14 12:03 am
      • 2009-10-14 12:32 am
        • 2009-10-14 12:47 am
          • 2009-10-14 1:17 am
          • 2009-10-14 1:41 am
          • 2009-10-14 2:30 am
          • 2009-10-14 3:46 am
          • 2009-10-14 4:08 am
          • 2009-10-14 8:30 am
          • 2009-10-14 10:31 am
          • 2009-10-14 11:07 am
          • 2009-10-16 6:23 am
          • 2009-10-14 3:28 pm
          • 2009-10-14 3:29 am
          • 2009-10-14 3:54 am
          • 2009-10-14 5:17 pm
          • 2009-10-14 3:45 am
          • 2009-10-14 3:21 am
          • 2009-10-14 5:39 pm
          • 2009-10-14 6:54 pm
          • 2009-10-14 11:56 pm
      • 2009-10-14 1:48 pm
  6. 2009-10-13 11:29 pm
  7. 2009-10-14 10:19 am
  8. 2009-10-14 10:41 am
    • 2009-10-14 11:18 am
    • 2009-10-14 12:37 pm
      • 2009-10-14 11:57 pm
      • 2009-10-15 1:53 pm