On Sun, Mar 6, 2011 at 2:34 PM, Peter Hosey <[email protected]> wrote:
> On Mar 6, 2011, at 13:30:14, Jeremy Gale wrote:
>>>> Would it be worth it for me to try ensuring all Apple Event calls and 
>>>> Growl calls are protected by a @synchronized block with a single semaphore 
>>>> even though they may be on different threads?
>>>
>>> Either that or do all such accesses on the main thread. The result is the 
>>> same: Your main thread will be blocked until the reply comes back, which 
>>> will be pretty quickly for Growl and probably a few seconds for iTunes.
>>>
>>> For debugging, I'd say go for it, but for release, you'll need to do better 
>>> than that. If serializing events and their replies works, then move the 
>>> EyeTunes-access code into a subprocess and communicate with it via DO.
>>
>> I'm obviously fairly out of my element here, but why do you say it wouldn't 
>> be good enough?
>
> Hanging (blocking the main thread) for several seconds is never good enough.
>
> That'll happen either way because if you do some iTunes access on a 
> background thread, a Growl access on the main thread will be blocked waiting 
> for the iTunes access to finish.
>
>> What would the difference be with it being in a subprocess - it would have 
>> it's own reply port and so no replies blocking each other?
>
> Yes, and your main app wouldn't be blocked for several seconds to for your DO 
> version of the reply to come in from the subprocess.

I see what you mean, and agree about not hanging the UI thread for
several seconds . The Apple Events that EyeTunes performs on iTunes do
behave synchronously and they actually come back relatively quickly.
Usually under 1 millisecond. I'm hoping that if the serialization of
events works, that would be good enough for release.

If not, do you think moving the Growl notifications to a subprocess
would be an acceptable alternative?

Jeremy

-- 
You received this message because you are subscribed to the Google Groups 
"Growl Discuss" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/growldiscuss?hl=en.

Reply via email to