Re: inter-thread communication
Re: inter-thread communication
- Subject: Re: inter-thread communication
- From: Jean-Daniel Dupas <email@hidden>
- Date: Thu, 11 Mar 2010 10:32:43 +0100
Le 10 mars 2010 à 22:14, Joel Reymont a écrit :
> Are there any examples of inter-thread (sync/async) communication at the Core Foundation level?
>
> I'm trying to put a user space USB "driver" into a framework. The driver will need its own thread and run loop. I need to be able to call into the driver and from the driver into user code running in another thread.
>
> I'm thinking of using CFMessagePort. Is this the best idea? Are there any examples?
>
> Thanks, Joel
For 10.6, uses Blocks, (CFRunLoopPerformBlock), else the simplest way is to use Foundation methods (except if you have a very good reason not to bind on Foundation).
With Foundation, you can use -[NSObject performSelectorOnThread:] methods.
Else if you want to use CFMessagePort and need sample code, I let you open Xcode, and search for "Related Sample Code" section in most CFMessagePortRef functions reference.
-- Jean-Daniel
_______________________________________________
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