Re: using grand central dispatch with c++ for inter-thread communication
Re: using grand central dispatch with c++ for inter-thread communication
- Subject: Re: using grand central dispatch with c++ for inter-thread communication
- From: David Leimbach <email@hidden>
- Date: Wed, 21 Apr 2010 09:49:01 -0700
On Wed, Apr 21, 2010 at 8:45 AM, Joel Reymont
<email@hidden> wrote:
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.
This is a good nutshell argument for why libdispatch and GCD kicks serious ass to program with in general. I wish every platform (especially linux, as I could really use it today in my day job for some small systems concurrency) had this at this point. Usually I don't like features for concurrency cobbled into a language that did not originally consider concurrency and threading as a primary concern (like any of the C family), but libdispatch is comfortable enough to get by when I can't have my Erlang or Haskell, or even Go.
I'm very happy to hear it's coming to iPhone OS 4 as well.
Dave
---
http://es.linkedin.com/in/joelreymont
http://twitter.com/wagerlabs
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (
email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden