On Sun, Mar 6, 2011 at 2:13 PM, Peter Hosey <[email protected]> wrote:
> On Mar 6, 2011, at 13:08:15, Jeremy Gale wrote:
>> On Sun, Mar 6, 2011 at 2:00 PM, Peter Hosey <[email protected]> wrote:
>>> If you mean your app is taking to both iTunes and Growl at the same time on 
>>> different threads, then yes, that could be the problem.
>>
>> Yes, that can definitely happen with my app. Is that inherently a problem?
>
> As far as I know, your app has only one reply port, so it may be.
>
> Of note: If EyeTunes is also using the synchronous calls, but the reply for 
> Growl comes in first (or vice versa), then the reply for Growl (or for 
> EyeTunes) might get eaten and dropped.

Hmm, interesting. Sounds like I need to read up on Apple Events much more.

One thing maybe worth mentioning - I've been using the EyeTunes code
both on the main thread and a background thread and haven't noticed
any problems so far.

>
>> 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? 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?

In terms of structure, the Growl notifications are far less pervasive
than the EyeTunes access, so if it's possible I'd maybe move the Growl
notifications to a subprocess.

Thanks Peter,

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