Re: IOCommandGate vs ISyncer
Re: IOCommandGate vs ISyncer
- Subject: Re: IOCommandGate vs ISyncer
- From: "Duane Murphy" <email@hidden>
- Date: Wed, 13 Aug 2008 12:30:59 -0700
Thanks Chris. I get the gist of how this works...
--- At Wed, 13 Aug 2008 10:27:53 -0700, Chris Sarcone wrote:
>Duane -
>
>What is the recipe for this seemingly simple task (that IOSyncer handles
>very nicely) with IOCommandGate.
>
>Easy recipe:
>
>Sync Call is made
>done = false;
>Send I/O asynchronously
>IOCommandGate::runAction()
> while (!done)
> IOCommandGate::commandSleep(&done,TH_UNINT);
>
>On workloop completion thread:
>done = true;
>IOCommandGate::commandWakeup(&done);
This is the part that I'm usually confused on.
Does the thread have to have the gate to call commandWakeup or can
commandWakeup be called anytime?
The completion thread is the callback for the completion of IO
(IOStorageCompletion). Can that callback just call commandWakeup or do I
have to enter the gate first using runAction and call commandWakeup from
the runAction call back?
Thanks again. This was very helpful.
...Duane
_______________________________________________
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