Fork me on GitHub

WiganWallgate

Implementation of the Grand Central Dispatch API for Leopard and iPhone

Introduction

First off, Hi! I don't know if you came via my website but most of my other projects live on my personal website at http://www.sysctl.co.uk/. This is an open implementation of the Grand Central Dispatch API provided in Mac OS X 10.6 (Snow Leopard). Not a very clever one but one nonetheless.

Requirements

Usage

Forgive me if this is in flux slightly, however, using Wigan Wallgate in your application should be relatively straight forward. The API is designed to conform to the dispatch/dispatch.h provided with Snow Leopard, unfortunately some fiddling is required because it isn't possible to automagically link WW into the CFRunloop of your main thread (like GCD does) or automatically initialise the worker threads used by WW.

In order to use WW, you should follow this small checklist:

  1. Copy the WiganWallgate.framework from the binary package of your choice (or compile it from source) into your Xcode project.
  2. Link the framework with your application.
  3. Copy the framework to your Frameworks/ directory (using a "Copy Files" build stage)
  4. Change your <dispatch/dispatch.h> include directives to <WiganWallgate/dispatch.h>
  5. Set your target SDK to 10.5
Hopefully (see the caveat below), it will soon be possible to compile against the 10.6 SDK whilst targeting Leopard with the compiler.

Also, WW is linked against PLBlocks and expects to find it "installed" in @executable_path/../Frameworks/ in order to link against it at runtime.

Coverage

So this is a relatively new project and here is how far I've got compared to the native GCD implementation. I've implemented enough to get a "useful" GCD based app off the group. Write fd support should be easy to add, some of the other sources ... not so much.

Implemented:

Caveats

My ultimate intention with WW is to allow you to compile your GCD based projects with the 10.6 SDK and link in WW to allow support for GCD calls on non-10.6 platforms. Currently the PLBlocks compile cannot target the 10.6 SDK whilst compiling code to run on Mac OS X 10.5, this is a problem that the PLBlocks group have talked about on their mailing list and hopefully will support sometime in the future. The effect of this is that you can choose to compile in one of two ways:

  1. targeting the 10.5 SDK, in this case ONLY WW code will ever be used. Even if the binary executes on Snow Leopard,
  2. or, targeting the 10.6 SDK; this makes your binary incompatible with 10.5 and stops you running on Leopard, however, you will take full advantage of a (hopefully) properly optimised GCD.
All this can be solved by weak linking once the compiler supports the correct compilation setup and should allow you to use GCD on 10.6 platforms while falling back to the WW implementation on other platforms. All in one binary.

Further to this, I do not boast any kind of performance tuning has gone into WW. This first cut is intended to provide a partially implemented set of the GCD API in order to keep my personal projects happy on Leopard. I would welcome suggestions, patches, forks, notes by carrier pigeon with your ideas on how better to optimise WW so it doesn't completely suck.

License

WiganWallgate is licensed under the MIT license which can be found here in the LICENSE file in my repository or here at the Open Source Initiative.

Authors

Matt Wright (matt@sysctl.co.uk)

Contact

Matt Wright (matt@sysctl.co.uk)

Download

Binary builds will be available once the codebase has stabilised and I've got some builds set up.

You can download the source code to this project in either zip or tar formats.

You can also clone the project with Git by running:

$ git clone git://github.com/daagaak/WiganWallgate