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.
1 comment
[ 5.2 ms ] story [ 17.5 ms ] threadI 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.