

Using Grand Central Dispatch and C++ for inter-thread communication - wagerlabs
http://wagerlabs.com/grand-central-dispatch-c-and-inter-thread-com

======
wagerlabs
A bit of context is probably due...

I wrote a user land USB driver and packaged it in a framework. The framework
starts the driver in a new thread upon initialization. I needed the separate
thread and needed a way to talk to it.

I explored Mach ports but these turned out to be too painful. Grand Central
Dispatch, on the other hand, turned out to be the answer to my prayers. I can
shuffle code and data back with no problems whatsoever.

As a bonus, my API calls are queued and serialized for me so I don't need to
lock portions of the driver for concurrent access.

