TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Using Grand Central Dispatch and C++ for inter-thread communication

6 pointsby wagerlabsabout 15 years ago

1 comment

wagerlabsabout 15 years ago
A bit of context is probably due...<p>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.<p>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.<p>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.